zoukankan      html  css  js  c++  java
  • 通过C#来加载X509格式证书文件并生成RSA对象

    private static RSACryptoServiceProvider GetPrivateKey(string priKeyFile, string keyPwd)
    {
        var pc = new X509Certificate2(priKeyFile, keyPwd, X509KeyStorageFlags.MachineKeySet);
        return (RSACryptoServiceProvider) pc.PrivateKey;
    }
    
    private static RSACryptoServiceProvider GetPublicKey(string pubKeyFile)
    {
        var pc = new X509Certificate2(pubKeyFile);
        return (RSACryptoServiceProvider) pc.PublicKey.Key;
    }

    *.cer格式公钥证书及*.pfx格式私钥证书

  • 相关阅读:
    LabVIEW入门第三天(软件及驱动包下载)
    poj1732
    poj1722
    poj1821
    poj1770
    poj1949
    poj1726
    poj1699
    poj1682
    poj1853
  • 原文地址:https://www.cnblogs.com/frankyou/p/5909667.html
Copyright © 2011-2022 走看看