使用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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM