Arun kumar R
Arun kumar R

Reputation: 285

How to make PKCS12 (PKCS#12) contain more than one private key in .p12 container?

I used Openssl to create a PKCS12 .p12 container storing a private key, server certificate and a CACertificate (Self signed) and I was able to export/parse the same successfully.

But I want to know how I can add more than one Private key to the same container. For example - I have 2 sets of server certificate and 2 private keys that I need add to the single .p12 container. From that .p12 container I want to parse and extract both private keys separately along with 2 server certificates.

In this link, it is mentioned that it is possible to do so but there are no answers on how to achieve it.

How can I achieve this? How can I save private keys(PK1 and PK2) and Server certs (C1, C2) into .p12 and extract them using OpenSsl?

Upvotes: 7

Views: 2873

Answers (1)

maoizm
maoizm

Reputation: 729

While you can use OpenSSL utility directly as mentioned in the comments to original question, you might consider Keystore Explorer GUI tool for maintaining multiple certificate/key pairs in a single PKCS12 store file.

The content of PKCS12 file with multiple items looks as follows: screenshot of Keystore Explorer window

Upvotes: 1

Related Questions