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

查看:35
本文介绍了从 .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天全站免登陆