AW.Pay.Core.RSAFromPkcs8.DecodePemPrivateKey C# (CSharp) Method

DecodePemPrivateKey() private static method

解析java生成的pem文件私钥
private static DecodePemPrivateKey ( String pemstr ) : RSACryptoServiceProvider
pemstr String
return System.Security.Cryptography.RSACryptoServiceProvider
        private static RSACryptoServiceProvider DecodePemPrivateKey(String pemstr)
        {
            byte[] pkcs8privatekey;
            pkcs8privatekey = Convert.FromBase64String(pemstr);
            if (pkcs8privatekey != null)
            {

                RSACryptoServiceProvider rsa = DecodePrivateKeyInfo(pkcs8privatekey);
                return rsa;
            }
            else
                return null;
        }