How to extract private key from PFX file

Sometimes you receive a PFX file, which is a file that bundles both certificate and private key of a SSL certificate. Here's how to extract the private key.

Mark van Eijk 1 minute read Security

For this we need the openssl command line tool. Using the following command you can extract the private key from a PFX file:

openssl pkcs12 -in pfx-file.pfx -nocerts -out private-key-file.pem -nodes