使用OpenSSL转换X509 PEM与PFX证书

PKCS(Public Key Cryptography Standards)

PKCS12:定义了包含私钥与公钥证书(public key certificate)的文件格式。私钥采密码(password)保护。常见的PFX就履行了PKCS#12。

 

X509(PEM格式的)转PFX格式:

openssl pkcs12 -export -inkey test.key -in test.cer -out test.pfx

注:test.key和test.cert都是PEM格式的私钥和公钥证书

  

PFX转X509:

openssl pkcs12 -in test.pfx -nodes -out test.pem
openssl rsa -in test.pem -out test.key
openssl x509 -in test.pem -out test.crt

posted @ 2017-09-25 12:20  FrankYou  阅读(3780)  评论(0编辑  收藏  举报