我想动态生成RSA X509公/私钥,以下是我使用openssh命令行的方法:
openssl genrsa -out privatekey.pem 1024
openssl req -new -x509 -key privatekey.pem -out publickey.cer -days 1825
openssl pkcs12 -export -out public_privatekey.pfx -inkey privatekey.pem -in publickey.cer
还有,我如何添加密码短语以加密私钥?
到目前为止,我只完成了这一部分。
//Generate a public/private key pair.
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
//Save the public key information to an RSAParameters structure.
RSAParameters rsaKeyInfo = rsa.ExportParameters(true);
我曾使用过这个类,但它并没有产生有效的SSL,在我将其提交给开发者门户时,它没有被接受为有效的公钥:developer.xero.com/myapps。
敬礼