拿到一个证书,里面有私钥和公钥,合在一起,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可能不需要加

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

相关文章:

  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
猜你喜欢
  • 2021-09-25
  • 2022-02-14
  • 2021-07-21
  • 2021-12-23
  • 2021-08-30
  • 2021-06-02
相关资源
相似解决方案