Exemple #1
0
 /// <summary>
 /// 读取经过BASE64编码的PKCS#1格式RSA公钥
 /// </summary>
 /// <param name="baPKCS1"></param>
 /// <returns></returns>
 public static BigInteger[] PKCS1_Pub_Read(string strPKCS1)
 {
     try
     {
         strPKCS1 = strPKCS1.Remove(0, 31);
         strPKCS1 = strPKCS1.Remove(strPKCS1.LastIndexOf("\n-----END RSA PUBLIC KEY-----\n"));
         strPKCS1 = strPKCS1.Replace("\n", "");
     }
     catch (Exception inner)
     {
         throw new RSAKeyFormatErrorException(inner);
     }
     return(PKCS1_Read(BASE64_Main.DecodeB(Encoding.UTF8.GetBytes(strPKCS1))));
 }
Exemple #2
0
 public byte[] BASE64_Decrypt(string strData)
 {
     return(BASE64_Main.DecodeB(Encoding.UTF8.GetBytes(strData)));
 }