How to extract Private Key from PKCS 12 (Pfx/P12)

How to extract Private Key from PKCS 12 (Pfx/P12)

Unlike the Public Key which is visible in the Certificate Details page, the private key wont be visible and can't be downloaded directly. To download that in a readable format or as a text file follow the steps below,

Download and install OpenSSL in your Windows or Linux machine,

 

https://www.xolphin.com/support/ssl/OpenSSL/OpenSSL_-_Installation_under_Windows

 

Once the installation is complete , place the p12 or pfx file in OpenSSL\bin path and execute the below command,

 

openssl pkcs12 -in filename.p12 -nodes -nocerts -out privatekey.pem

 

The above command will ask for the keystore password. Enter the same and it will reply as MAC verified OK and a file named PrivateKey.pem in the same path.

 

You can open the file in Notepad and copy the private key.

                  New to ADSelfService Plus?