WillSquire
9/9/2019 - 9:46 AM

Convert pfx SSL certificate to cert/primary key

Requires the passcode for the .pfx file prior.

Extract .key file from .pfx file (will need to set a password here too):

openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]

Extract .crt file from .pfx file:

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

Extract pem formatted .key from previous .key:

openssl rsa -in [keyfile-encrypted.key] -outform PEM -out [keyfile-encrypted-pem.key]

Source: