Beispiel #1
0
 /// <summary>
 /// Export RSA public key
 /// </summary>
 /// <param name="rsa"></param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException"></exception>
 public static byte[] ExportRSAPublicKey(this RSA rsa)
 {
     if (rsa is null)
     {
         throw new ArgumentNullException(nameof(rsa));
     }
     return(Convert.FromBase64String(rsa.ToPkcs1PublicString()));
 }