create a pfx file from a .cer and a .pem file

╄→尐↘猪︶ㄣ 提交于 2019-12-28 05:51:28

问题


I have used openssl to create a .key and .cer file in pem format (you can read them). Now I want to create .pfx file from them. I have read openssl doumentation it says something like following command I can use

openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer

but I don't know which one is my .cer file (certificate.cer or CACert.cer) what is differences between these two files?


回答1:


The certificate.cer is your public key and the CACert.cer file (as it names suggest) is the public key of a CA (maybe the one who has signed your certificate).

The -in switch specifies input certificate to embed in output file

The -inkey switch specifies the key file you've generated using OpenSSL

The -out switch tells the openssl your desired name for output file

The -certfile is used to specify additional certificates to add to the output pfx file (it could be ignored)



来源:https://stackoverflow.com/questions/19199293/create-a-pfx-file-from-a-cer-and-a-pem-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!