RSACryptoServiceProvider

RSACryptoServiceProvider

从我从 keystore 中取出的RSACryptoServiceProvider初始化新的X509Certificate2对象的最佳方法是什么?该证书与公共(public)(用于加密)和私有(private)(用于解密) key 相关联。

我目前正在使用FromXmlString方法,但是必须有更好的方法。

谢谢

最佳答案

RSACryptoServiceProvider publicKeyProvider =
    (RSACryptoServiceProvider)certificate.PublicKey.Key;


RSACryptoServiceProvider privateKeyProvider =
    (RSACryptoServiceProvider)certificate.PrivateKey;

证书的公共(public)或私有(private) key 属性上的 key 属性的类型为AsymmetricAlgorithm。

关于c# - 从x509Certificate2初始化RSACryptoServiceProvider的最佳方法?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5872868/

10-09 05:38