Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ See [Xamarin's official trouble shooting docs first.](https://developer.xamarin.
* **Q:** It is hard to read English.
* **A:** You can read localized Xamarin docs with putting `{region}-{lang}` as the first component of URL path such as `https://developer.xamarin.com/ja-jp/guides/...`.

## Maintenance

### MsgPack.Windows.sln

This solution contains Silverlight5 and (old) UWP project for backward compability. They are required Visual Studio 2015 to build and test.
You can download Visual Studio 2015 community edition from [here](https://visualstudio.microsoft.com/vs/older-downloads/).

**You do not have to install Visual Studio 2015 as long as you don't edit/test/build Silverlight and/or old UWP project.**

## See also

* GitHub Page : http://cli.msgpack.org/
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified test/MsgPack.UnitTest.Uwp/MsgPack.UnitTest.Uwp_TemporaryKey.pfx
Binary file not shown.
Binary file not shown.
49 changes: 49 additions & 0 deletions tools/MakeCert/New-TestCerft.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<#
.SYNOPSIS
Make test certificate for UWP unit test programs.
.PARAMETER FilePath
Specify output file path. Default is "./testcert.pfx"
.DESCRIPTION
This script makes self-signed certificates for code signing with CN=MsgPack.Cli.UnitTest, RSA256, SHA256 with maximum expiry date.
Note that the pfx file has empty password.
#>
#requires -Version 5.1

using namespace System.IO
using namespace System.Security.Cryptography
using namespace System.Security.Cryptography.X509Certificates

[CmdletBinding(PositionalBinding = $false)]
param(
[ValidateNotNullOrEmpty()][string]$FilePath = "./testcert.pfx"
)

Set-StrictMode -Version 5.1

[string]$subject = "CN=MsgPack.Cli.UnitTest"
[RSA]$password = [RSA]::Create(2048)
[HashAlgorithmName]$hashAlgorithm = [HashAlgorithmName]::SHA256
[RSASignaturePadding]$padding = [RSASignaturePadding]::Pkcs1
[DateTimeOffset]$notBefore = [System.DateTimeOffset]::new(2019, 10, 1, 0, 0, 0, 0)
# Some implementation has year 2037 problem, they cannot accept date after 2038/01/19.
[DateTimeOffset]$notAfter = [System.DateTimeOffset]::FromUnixTimeSeconds([Int32]::MaxValue)

# Try load CertificateRequest type dinamically to support multiple platforms...
$certReqType = [System.Linq.Enumerable].Assembly.GetType("System.Security.Cryptography.X509Certificates.CertificateRequest")
if ($null -eq $certReqType) {
# This should be pwsh
$certReqType = [X509Certificate].Assembly.GetType("System.Security.Cryptography.X509Certificates.CertificateRequest")
if ($null -eq $certReqType) {
throw [PlatformNotSupportedException]::new("pwsh, or PowerShell with .NET Framework 4.7.2 or later is required.");
}
}

# Create CertificateRequest instance
$certReq = $certReqType::new($subject, $password, $hashAlgorithm, $padding)
# This cert is for code signing:
$certReq.CertificateExtensions.Add([X509EnhancedKeyUsageExtension]::new([X509Extension]::new([Oid]::FromOidValue("2.5.29.37", [OidGroup]::All ), @(48, 10, 6, 8, 43, 6, 1, 5, 5, 7, 3, 3), $true), $true))
# This cert is end entity: 2.5.29.19, {48,0}, critical.
$certReq.CertificateExtensions.Add([X509BasicConstraintsExtension]::new([X509Extension]::new([Oid]::FromOidValue("2.5.29.19", [OidGroup]::All ), @(48, 0), $true), $true))

[X509Certificate2]$cert = $certReq.CreateSelfSigned($notBefore, $notAfter)
[File]::WriteAllBytes($FilePath, $cert.Export([X509ContentType]::Pfx, [String]::Empty))