示例#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);
 }
示例#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))
 {
 }
示例#3
0
 public void LoadKeyWithInvalidObject()
 {
     Assert.Throws <AcmeException>(() => KeyInfo.From(new MemoryStream()));
 }
示例#4
0
文件: PfxBuilder.cs 项目: zr3/certes
 /// <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;
 }