以下代码可在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中不存在。