Extracting certificate and private key files from a PFX container

If the certification authority provided the certificate as a PFX container (PKCS#12 format, file with the PFX or P12 extension), you must extract PEM-encoded certificate and private key files from the container.

You can extract the certificate and private key files using openssl. To extract the files, you will need to enter the passphrase of the PFX container.

To extract the private key file, use the following command:

openssl pkcs12 -in source.pfx -nocerts -nodes -out key.pem

To extract the certificate key file, use the following command:

openssl pkcs12 -in source.pfx -clcerts -nokeys -out cert.pem

You will get the following files:

You can use the private key and certificate files thus obtained to replace the web interface certificate.

Page top