示例#1
0
 /// <summary>
 /// 导出PEM PKCS#8格式密钥对,如果convertToPublic含私钥的RSA将只返回公钥,仅含公钥的RSA不受影响
 /// </summary>
 public string ToPEM_PKCS8(bool convertToPublic = false)
 {
     return(RSA_PEM.ToPEM(rsa, convertToPublic, true));
 }
示例#2
0
        /// <summary>
        /// 通过一个pem文件创建RSA,pem为公钥或私钥,出错抛异常
        /// </summary>
        public RSA(string pem, bool noop)
        {
            _init();

            rsa = RSA_PEM.FromPEM(pem);
        }