在 C# 中,我们有一种方法可以从模数字符串中计算出 RSA 密钥大小,如下所示,
有没有类似的方法来获取 JavaScript 或打字稿中的密钥大小?
var bytesModulus = Convert.FromBase64String(modulusString);
using (var rsa = new RSACryptoServiceProvider())
{
var rsaKeyInfo = rsa.ExportParameters(false);
rsaKeyInfo.Modulus = modulus;
rsa.ImportParameters(rsaKeyInfo);
return rsa.KeySize;
}