使用openssl将多个证书加载到PKCS12中 [英] Load multiple certificates into PKCS12 with openssl

查看:630
本文介绍了使用openssl将多个证书加载到PKCS12中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用openssl将多个证书加载为PKCS12格式.命令如下:

I am trying to load multiple certificates using openssl into the PKCS12 format. The command is as follows:

openssl pkcs12 -export -in cert1.arm -inkey cert1_private_key.pem -certfile cert2.arm -certfile cert3.arm -certfile RootCert.pem -name "Test" -out test.p12

已经解析了生成的PKCS12文件,只有最后一个证书已包含在文件中:

Having parsed the generated PKCS12 file, only the last certificate has been included into the file:

openssl pkcs12 -in test.p12 -info -nodes

我还尝试将它们分别导入pkcs12文件,而在所有尝试中,仅最后一个证书保留在文件中.

I also tried to import them separately into the pkcs12 file while in all the attempts, only the last certificate was remained in the file.

有什么想法可以解决问题吗?

Any idea where is the problem to solve it?

推荐答案

首先,确保所有证书都采用PEM格式.然后,制作一个名为"certs.pem"的单一文件,其中包含其余证书(cert2.arm,cert3.arm和RootCert.pem).

First, make sure all your certificates are in PEM format. Then, make a SINGLE file called "certs.pem" containing the rest of the certificates (cert2.arm, cert3.arm, and RootCert.pem).

然后使用如下命令:

openssl pkcs12 -export -in cert1.arm -inkey cert1_private_key.pem -certfile certs.pem -name "Test" -out test.p12

openssl pkcs12 文档介绍了不同的选项.

The openssl pkcs12 documentation explains the different options.

这篇关于使用openssl将多个证书加载到PKCS12中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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