生成客户端信任的证书文件

创建“keystore”文件
keytool -genkey -alias hylink -keyalg RSA -keystore d:\hylink.keystore

创建自签名证书 
keytool -selfcert -alias hylink -keystore d:\hylink.keystore

证书导出 
keytool -export -alias hylink -keystore d:\hylink.keystore -storepass 123456 -rfc -file d:\hylink.cer

keystore 格式转PKCS12
keytool -importkeystore -srckeystore d:\hylink.keystore -destkeystore D:\hylink.p12 -srcstoretype JKS -deststoretype PKCS12

pkcs12 转pem私钥
openssl pkcs12 -nocerts -nodes -in d:\hylink.p12 -out d:\key.pem

pkcs12 转cert证书
openssl pkcs12 -clcerts -nokeys -in d:\hylink.p12 -out d:\cert.pem

posted on 2018-04-19 17:38  疯狂的小萝卜头  阅读(592)  评论(0编辑  收藏  举报