.Net 4中的GetRSAPublicKey等效于什么?

时间:2019-03-16 02:15:01

标签: .net-core .net-4.0 x509certificate2

以下代码可在dotnetCore中工作,但我正在寻求与.NET 4等效的代码

var x509Certificate2 = new X509Certificate2(Convert.FromBase64String(publicKey));
                using (RSA rsa = x509Certificate2.GetRSAPublicKey())
                {
                    cipherText = rsa.Encrypt(GetBytes(ak), RSAEncryptionPadding.OaepSHA1);
                }

GetRSAPublicKey ()在.NET 4中不存在。

0 个答案:

没有答案
相关问题