Skip to content

Commit

Permalink
fix csr builder not using the provided key
Browse files Browse the repository at this point in the history
  • Loading branch information
fszlin committed Dec 8, 2016
1 parent 621003d commit 1dc1057
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Certes/Pkcs/CertificationRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,22 @@ public class CertificationRequestBuilder : CertificationRequestBuilderBase
/// Initializes a new instance of the <see cref="CertificationRequestBuilder"/> class.
/// </summary>
/// <param name="keyInfo">The key information.</param>
/// <exception cref="System.NotSupportedException">
/// If the provided key is not one of the supported <seealso cref="SignatureAlgorithm"/>.
/// </exception>
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();
}
}

/// <summary>
Expand Down

0 comments on commit 1dc1057

Please sign in to comment.