Creating a .pem with the Private Key and Entire Trust Chain
Convert P12/pfx to pem
Export Private Key From a PKCS#12 File with OpenSSL
openssl pkcs12 -in [yourfile.pfx] -nocerts -out [drlive.key]
Export Certificate From a PKCS#12 File with OpenSSLÂ
openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [drlive.crt]
Decrypt the Private Key
openssl rsa -in [drlive.key] -out [drlive-decrypted.key]
Open a text editor (such as wordpad) and paste the entire body of each certificate into one text file in the following order:
The Private Key - your_domain_name.key
The Primary Certificate - your_domain_name.crt
The Intermediate Certificate - DigiCertCA.crt
The Root Certificate - TrustedRoot.crt
Make sure to include the beginning and end tags on each certificate. The result should look like this:
-----BEGIN RSA PRIVATE KEY-----
(Your Private Key: your_domain_name.key)
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
(Your Primary SSL certificate: your_domain_name.crt)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
(Your Intermediate certificate: DigiCertCA.crt)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
(Your Root certificate: TrustedRoot.crt)
-----END CERTIFICATE-----