不同格式证书转换

  摘自:http://support.wosign.com/index.php?/Knowledgebase/Article/View/36/0/

  在专业认证中心申请证书拿到了对应证书和密钥(.crt文件 + .key文件),在配置tomcat SSL通信时,利用这两个文件产生密钥库。

  这里记录不同格式证书直接的转换命令:

  • .pfx 转 .cer, .crt, .key
openssl pkcs12 -in test.wosign.pfx -nodes -out test.pem
openssl rsa -in test.pem -out test.key 
openssl x509 -in test.pem -out test.crt
openssl x509 -in test.pem -out test.cer
  • .key + .cer 转 .pfx
openssl pkcs12 -export -in client1.crt -inkey client1.key -out client1.pfx
  • .pfx 转 .jks
keytool -importkeystore -srckeystore aaa.pfx -destkeystore 173.jks -srcstoretype PKCS12 -deststoretype JKS
  • .jks 转 .pfx
JKS2PFX server.jks 123456 tomcat exportfile c:progra~1Javajre1.5.0_06in   (转换后文件存放在相应目录下)

  

原文地址:https://www.cnblogs.com/chenyongjun/p/4480668.html