从.cer和.pem文件创建pfx文件 [英] create a pfx file from a .cer and a .pem file

查看:269
本文介绍了从.cer和.pem文件创建pfx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆