Certificate Formats and Conversion Guide

Common Certificate Formats

Conversion Commands Using OpenSSL

Convert .PFX to .PEM (Linux)

openssl pkcs12 -in certificate.pfx -out certificate.pem -nodes

This will extract the certificates and private key from a .PFX file into a .PEM file.

Convert .PEM to .PFX (Windows)

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.pem -certfile CAchain.pem

This will combine the .PEM certificate and private key into a .PFX file.

Convert .PEM to .CER/.CRT

Convert .CER/.CRT to .PEM

openssl x509 -inform der -in certificate.cer -out certificate.pem

This converts a DER-encoded .CER certificate to a Base64-encoded .PEM certificate.

Summary