public static byte[] ToCapiKeyBlob(DSA dsa, bool includePrivateKey) { if (dsa == null) { throw new ArgumentNullException(nameof(dsa)); } return(includePrivateKey ? CryptoConvert.ToCapiPrivateKeyBlob(dsa) : CryptoConvert.ToCapiPublicKeyBlob(dsa)); }
public static byte[] ToCapiKeyBlob(RSA rsa, bool includePrivateKey) { if (rsa == null) { throw new ArgumentNullException("rsa"); } if (includePrivateKey) { return(CryptoConvert.ToCapiPrivateKeyBlob(rsa)); } return(CryptoConvert.ToCapiPublicKeyBlob(rsa)); }