从.cer和.pem文件创建pfx文件 [英] create a pfx file from a .cer and a .pem file
问题描述
我已经使用openssl来创建pem格式的.key和.cer文件(您可以阅读它们).现在,我想从它们创建.pfx文件.我已经读过openssl doumentation,上面写着类似下面我可以使用的命令
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
但是我不知道我的.cer文件是哪一个(certificate.cer或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?
推荐答案
certificate.cer
是您的公钥,而CACert.cer
文件(顾名思义)是CA的公钥(也许是签署了您的证书).
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).
-in
开关指定要嵌入到输出文件中的输入证书
The -in
switch specifies input certificate to embed in output file
-inkey
开关指定您使用OpenSSL生成的密钥文件
The -inkey
switch specifies the key file you've generated using OpenSSL
-out
开关告诉openssl您想要的输出文件名称
The -out
switch tells the openssl your desired name for output file
-certfile
用于指定要添加到输出pfx文件的其他证书(可以忽略)
The -certfile
is used to specify additional certificates to add to the output pfx file (it could be ignored)
这篇关于从.cer和.pem文件创建pfx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!