diff --git a/src/Certes/AcmeClient.cs b/src/Certes/AcmeClient.cs index a6b3cf8e..6a1fde53 100644 --- a/src/Certes/AcmeClient.cs +++ b/src/Certes/AcmeClient.cs @@ -72,6 +72,8 @@ public async Task NewRegistraton(params string[] contact) { Links = result.Links, Data = result.Data, + Json = result.Json, + Raw = result.Raw, Location = result.Location, Key = key.Export(), ContentType = result.ContentType @@ -134,6 +136,8 @@ public async Task> NewAuthorization(AuthorizationIdentifier id return new AcmeResult { Data = result.Data, + Json = result.Json, + Raw = result.Raw, Links = result.Links, Location = result.Location, ContentType = result.ContentType @@ -153,6 +157,8 @@ public async Task> GetAuthorization(Uri location) return new AcmeResult { Data = result.Data, + Json = result.Json, + Raw = result.Raw, Links = result.Links, Location = result.Location ?? location, ContentType = result.ContentType @@ -210,6 +216,8 @@ public async Task> CompleteChallenge(Challenge authChallen return new AcmeResult { Data = result.Data, + Json = result.Json, + Raw = result.Raw, Links = result.Links, Location = result.Location, ContentType = result.ContentType @@ -264,7 +272,6 @@ public async Task NewCertificate(ICertificationRequestBuilder c currentCert.Issuer = new AcmeCertificate { Raw = issuerResult.Raw, - Key = csrProvider.Export(), Links = issuerResult.Links, Location = issuerResult.Location, ContentType = issuerResult.ContentType diff --git a/src/Certes/Pkcs/CertificationRequestBuilder.cs b/src/Certes/Pkcs/CertificationRequestBuilder.cs index b3dccbdb..deb04dbf 100644 --- a/src/Certes/Pkcs/CertificationRequestBuilder.cs +++ b/src/Certes/Pkcs/CertificationRequestBuilder.cs @@ -32,9 +32,22 @@ public class CertificationRequestBuilder : CertificationRequestBuilderBase /// Initializes a new instance of the class. /// /// The key information. + /// + /// If the provided key is not one of the supported . + /// public CertificationRequestBuilder(KeyInfo keyInfo) { this.keyInfo = keyInfo; + + this.KeyPair = keyInfo.CreateKeyPair(); + if (this.KeyPair.Private is RsaPrivateCrtKeyParameters) + { + this.Algorithm = SignatureAlgorithm.Sha256WithRsaEncryption; + } + else + { + throw new NotSupportedException(); + } } /// diff --git a/src/Certes/project.json b/src/Certes/project.json index 3fdd1d5b..cd252e16 100644 --- a/src/Certes/project.json +++ b/src/Certes/project.json @@ -4,7 +4,7 @@ "description": "A client implantation for the Automated Certificate Management Environment (ACME) protocol", "dependencies": { "Newtonsoft.Json": "9.0.1", - "Portable.BouncyCastle": "1.8.1.1", + "Portable.BouncyCastle": "1.8.1.2", "System.Net.Http": "4.3.0", "System.Runtime.InteropServices": "4.3.0" }, diff --git a/test/Certes.Tests/project.json b/test/Certes.Tests/project.json index 717d142c..97950df3 100644 --- a/test/Certes.Tests/project.json +++ b/test/Certes.Tests/project.json @@ -15,7 +15,7 @@ }, "Moq": "4.6.38-alpha", "System.Diagnostics.TraceSource": "4.3.0", - "Portable.BouncyCastle": "1.8.1.1" + "Portable.BouncyCastle": "1.8.1.2" }, "frameworks": {