コード例 #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
ファイル: PfxBuilder.cs プロジェクト: TeneoData/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, signatureAlgorithmProvider.GetKey(privateKeyInfo.PrivateKeyInfo))
 {
 }
コード例 #3
0
ファイル: KeyInfoTests.cs プロジェクト: yurikus/certes
 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;
 }