예제 #1
0
 public static byte[] ToCapiKeyBlob(DSA dsa, bool includePrivateKey)
 {
     if (dsa == null)
     {
         throw new ArgumentNullException(nameof(dsa));
     }
     return(includePrivateKey ? CryptoConvert.ToCapiPrivateKeyBlob(dsa) : CryptoConvert.ToCapiPublicKeyBlob(dsa));
 }
예제 #2
0
 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));
 }