AW.Pay.Core.RSAFromPkcs8.DecodePemPrivateKey C# (CSharp) Метод

DecodePemPrivateKey() приватный статический Метод

解析java生成的pem文件私钥
private static DecodePemPrivateKey ( String pemstr ) : RSACryptoServiceProvider
pemstr String
Результат 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;
        }