Convert PEM to PFX (PKCS#12) and Between SSL Certificate Formats (2026)
SSL certificates come in multiple file formats, and different platforms require different formats. Apache and Nginx use PEM (separate .crt and .key files). Microsoft IIS, Azure, and load balancers typically require PFX (PKCS#12), which bundles the certificate, chain, and private key into a single password-protected file. Java applications use JKS keystore format. All conversions can be done with OpenSSL.
Converting Certificates on macOS
macOS Terminal includes LibreSSL (OpenSSL-compatible) — all the conversion commands shown in this guide work without modification. For formats that require newer OpenSSL features, install via Homebrew: brew install openssl.
Import a PFX into macOS Keychain
To install a certificate on macOS for use in Safari, system apps, or Homebrew servers:
Verify your certificate after conversion
After converting and installing your certificate, check it's properly installed and the chain is complete.