/// <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); }
/// <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)) { }
public void LoadKeyWithInvalidObject() { Assert.Throws <AcmeException>(() => KeyInfo.From(new MemoryStream())); }
/// <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; }