使用 OpenSSL 1.0.0a 创建具有多个证书的 PKCS#12 密钥库

发布于 2024-09-29 20:42:23 字数 555 浏览 3 评论 0原文

我正在尝试创建一个具有多个证书的 PKCS#12 密钥库。这个选项似乎确实有很好的记录 - 每个人都谈论从 .pem 文件中的单个证书创建 .p12 文件,如下所示:

openssl pkcs12 -export -in my_single_signed_cert.pem -out keystore.p12 -name "Alias1"

这每次都会创建一个新的 .p12 文件。如果您尝试使用 2 个证书创建 1 个密钥库,如下所示:

openssl pkcs12 -export -in my_signed_cert.pem -out keystore.p12 -name "Alias1"
openssl pkcs12 -export -in my_other_signed_cert.pem -out keystore.p12 -name "Alias2"

keystore.p12 文件仅包含“Alias2”。

我必须使用 PKCS#12(企业工具集需要它),而且我知道 JKS 可以很好地导入证书。

有什么建议吗?

I am trying to create a PKCS#12 keystore with more than one certificate. this option does seem to be documented well - everyone talks about creating a .p12 file from a single certicate in a .pem file, like this:

openssl pkcs12 -export -in my_single_signed_cert.pem -out keystore.p12 -name "Alias1"

this creates a new .p12 file each time. If you try to create 1 keystore with 2 certificates like this:

openssl pkcs12 -export -in my_signed_cert.pem -out keystore.p12 -name "Alias1"
openssl pkcs12 -export -in my_other_signed_cert.pem -out keystore.p12 -name "Alias2"

the keystore.p12 file contains only "Alias2".

I have to use PKCS#12 (enterprise toolset requires it), and I know JKS can import certs just fine.

Any suggestions ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

追我者格杀勿论 2024-10-06 20:42:23

我看到有两种方法可以做到这一点:

  1. 创建一个包含您需要的所有证书的 PEM 文件

  2. 使用 -certfile 选项定义更多证书

I see two ways to do this:

  1. Create a PEM file with all the certificates you need

  2. Use the -certfile option to define more certificates

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文