SSL Convert FAQ

Common questions about SSL certificate format conversion

Certificate Format Comparison

FormatExtensionEncodingUsage
PEM.pem, .crt, .keyBase64 (ASCII)Most common format, used by Apache, Nginx
DER.der, .cerBinary (DER)Binary format, used by Java, some Windows apps
P7B/PKCS#7.p7b, .p7cBase64 (ASCII)Certificate chain format, used by Windows
PFX/PKCS#12.pfx, .p12Binary (DER)Archive format with private key, used by Windows/IIS

Common Conversions

PEM → DER

Convert PEM to DER binary format

openssl x509 -in cert.pem -outform DER -out cert.der

DER → PEM

Convert DER binary to PEM text format

openssl x509 -in cert.der -inform DER -outform PEM -out cert.pem

PEM → P7B

Convert PEM certificate to PKCS#7 format

openssl crl2pkcs7 -nocrl -certfile cert.pem -out cert.p7b

P7B → PEM

Convert PKCS#7 to PEM certificate format

openssl pkcs7 -in cert.p7b -print_certs -out cert.pem

PEM → PFX

Convert PEM certificate and key to PFX archive

openssl pkcs12 -export -out cert.pfx -inkey private.key -in cert.pem -certfile chain.pem

PFX → PEM

Extract PEM certificate and key from PFX archive

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

Tips

  • Always backup your certificates before converting
  • Keep your private key secure during conversion
  • Verify the converted certificate works correctly
  • Some conversions require the private key password