Example #1
0
 /// <summary>
 /// Gets the key pair.
 /// </summary>
 /// <param name="keyInfo">The key data.</param>
 /// <returns>The key pair</returns>
 internal static AsymmetricCipherKeyPair CreateKeyPair(this KeyInfo keyInfo)
 {
     var(_, keyPair) = keyAlgorithmProvider.GetKeyPair(keyInfo.PrivateKeyInfo);
     return(keyPair);
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PfxBuilder"/> class.
 /// </summary>
 /// <param name="certificate">The certificate.</param>
 /// <param name="privateKeyInfo">The private key information.</param>
 public PfxBuilder(byte[] certificate, KeyInfo privateKeyInfo)
     : this(certificate, signatureAlgorithmProvider.GetKey(privateKeyInfo.PrivateKeyInfo))
 {
 }
Example #3
0
 public void LoadKeyWithInvalidObject()
 {
     Assert.Throws <AcmeException>(() => KeyInfo.From(new MemoryStream()));
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PfxBuilder"/> class.
 /// </summary>
 /// <param name="certificate">The certificate.</param>
 /// <param name="privateKeyInfo">The private key information.</param>
 public PfxBuilder(byte[] certificate, KeyInfo privateKeyInfo)
 {
     this.certificate    = certParser.ReadCertificate(certificate);
     this.privateKeyInfo = privateKeyInfo;
 }