How to extract a Certificate and a Private Key Files from a *.pfx file

54 users found this article helpful


To extract separate Certificate and Private key files from the *.pfx file follow the procedure below:

  1. Download and extract the Win32 OpenSSL package to C:\ directory.
  2. Open a command prompt, and move to the OpenSSL-Win32\bin directory, using:

    cd C:\OpenSSL\bin  
  3. Execute the following command to export Private Key file:

    openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]
  4. Then remove the passphrase from the Private Key

    openssl rsa -in [keyfile-encrypted.key] -out [keyfile-decrypted.key] 
  5. Export certificate file:

    openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]

Was this article helpful?

Tell us how we can improve it.