【问题标题】:Public key extraction from a certificate in C#从 C# 中的证书中提取公钥
【发布时间】:2012-08-30 05:51:51
【问题描述】:

如何从 x509 v.3 证书中获取私钥并将其存储在 RSACryptoServiceProvider 类中?

【问题讨论】:

    标签: c# cryptography x509certificate digital-certificate rsacryptoserviceprovider


    【解决方案1】:
    RSACryptoServiceProvider rsaCsp = (RSACryptoServiceProvider)x509certificateobject.PrivateKey;
    

    假设如果您使用公钥,那么只需将.PrivateKey 更改为.PublicKey

    【讨论】:

      【解决方案2】:
      RSACryptoServiceProvider rsaCsp = (RSACryptoServiceProvider)x509certificateobject.PrivateKey;
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-02-08
        • 2015-05-16
        • 1970-01-01
        • 2022-10-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-06-02
        相关资源
        最近更新 更多