Howto export RSA Private Key from bundle PKCS12 (*.p12)

Howto export RSA Private Key from bundle PKCS12 (*.p12)

When you want to set up SSL in Apache 2, you will need to provide to the service the following items: certificate for web-site, private key for that certificate, root CA certificate that issued web-site-certificate.

In my case I got from our sequrity-men p12-file which contains certificate itself and the private key. How to convert this p12 bundle to RSA private key?

Take openssl.exe and run the following commands:

openssl pkcs12 -in -nocerts -out -nodes
openssl pkcs12 -in -nokeys -out -nodes
openssl rsa -in -out -text

As the result you will get three files, and in one of them there will be the following section:


Take all this block and copy to separate text-file.

And thats it.


ssl (en)

  • Hits: 31397
Add comment

Related Articles