证书格式转换

命令转换:


===OpenSSL 转换===
DER to PEM
openssl x509 -out server.cer -in <your server cert> -inform DER
-outform PEM openssl pkey -out server.key -in <your privatekey>
-inform DER -outform PEM

PFX 查看
openssl pkcs12 -info -in <your pfx file>

PEM to PFX
openssl pkcs12 -export -out server.pfx -in <your server cert> -inkey
-certfile <our CACerts> -name <your keyalias>

PFX to PEM
openssl pkcs12 -clcerts -nokeys -out server.cer -in <your pfx file> &&
openssl pkcs12 -nocerts -out server.key -in <your pfx file> -nodes &&
openssl pkcs12 -cacerts -nokeys -out CACerts.txt -in <your pfx file>

===KeyTool 转换===
JKS 查看
keytool -list -v -keystore <your jks file>

PFX to JKS
keytool -importkeystore -srckeystore <your pfx file> -destkeystore
server.jks -srcstoretype PKCS12 -deststoretype JKS

JKS to PFX
keytool -importkeystore -srckeystore <your jks file> -destkeystore
server.pfx -srcstoretype JKS -deststoretype PKCS12

 

 在线工具:

https://www.ssltools.org/cert_convert.html

https://www.myssl.cn/tools/merge-jks-cert.html

OpenSSL for windows

https://wiki.openssl.org/index.php/Binaries

发表评论

电子邮件地址不会被公开。 必填项已用*标注