How to extract the certificate and keys from a .pfx

PFX file contains SSL Certificate which we can use for the website.

Below are the steps which you can use to extract the .PFX file

1: Download the tool name called OpenSSL.

2: Once you have file downloaded, unzip   the folder. Go to Bin folder and run the OpenSSL as an Administrator

3: Make sure you are running the tool on the same Machine where you have certificate installed.

4: Run the below command to extract the private key: :

pkcs12 -in CertificateName.pfx -nocerts -out CertificatePKCS12.key

5: Run the following command to extract the certificate:

pkcs12 -in CertificateName.pfx -clcerts -nokeys -out CertificatePKCS12.crt

6: Run the following command to decrypt the private key:

rsa -in CertificatePKCS12.key] -out CertificatePKCS12-decrypted.key

Note: After running each command you got option to create password. These passwords will not show in CMD PS, but make sure you have entered it correctly.

Now you will have all 3-file extracted and can be open in .txt format to get the Key which we need to copy & paste to the Domain Site.

Leave a Comment