常用数字证书格式相互转换-OpenSSL/Keytool/Jks2pfx
常用数字证书格式相互转换-OpenSSL/Keytool/Jks2pfx
1: pfx转换cer,crt,key
导出私钥必须输入密码
- openssl pkcs12 -in test.wosign.pfx -nodes -out test.pem
去除pem证书密码,转换成rsa格式,如果使用DSA格式,只需将rsa替换成dsa
- openssl rsa -in test.pem -out test.key
- openssl x509 -in test.pem -out test.crt(cer)
2: key和cer转换为pfx
- openssl pkcs12 -export -in client1.crt -inkey client1.key -out client1.pfx
3: .jks转为.pfx
- JKS2PFX server.jks 123456 tomcat exportfile c:\progra~1\Java\jre1.5.0_06\bin (转换后文件存放在相应目录下。)
4: .pfx转换.jks
- Keytool -importkeystore -srckeystore aaa.pfx -destkeystore 173.jks -srcstoretype PKCS12 -deststoretype JKS
5: 创建PFX格式证书(pkcs12 )
- openssl pkcs12 -export -in my.cer -inkey my.key -out mycert.pfx
6: 证书编码格式转换
- #PEM to DER
- openssl x509 -in cert.crt -outform der -out cert.der
- #DER to PEM
- openssl x509 -in cert.crt -inform der -outform pem -out cert.pem
浙公网安备 33010602011771号