windows系统请先确保安装了openssl,keytool
一.crt格式证书转pem
openssl x509 -in xx.crt -out xx.pem
二.crt转jks
1.先转成p12格式
openssl pkcs12 -export -in xx.crt -inkey xx.key -out xx.p12
2.p12格式转成jks
keytool -importkeystore -srckeystore xx.p12 -srcstoretype PKCS12 -destkeystore xx.jks -deststoretype JKS
会出现提示设置jks证书的密码,自行定义即可。