如何去掉私钥的密码

拿到一个证书,里面有私钥和公钥,合在一起,pkc12的格式转的pem格式,有密码,现在需要把密码去掉

1.分离公钥和私钥

openssl x509 -in cert2.pem -out cert2.crt

openssl rsa -in cert2.pem -out cert2.key

2. 去掉私钥密码

openssl rsa -in cert2.key -out cert22.key

3. 合并成pfx文件

openssl pkcs12 -export -inkey cert22.key -in cert2.crt -out cert2.pfx

4.转回 pem

openssl pkcs12 -in cert2.pfx -out cert22.pem

这个地方-nodes可能不需要加

中间需要运来私钥密码的时候就输入,如果新的私钥输密码直接回车

原文地址:https://www.cnblogs.com/caihemm/p/4447628.html