Skip to content

How to Convert a Apple Certificate .p12 file to a PEM File

To convert PKCS#p12 file to a PEM file, use:

openssl pkcs12 -in cert.p12 -out cert.pem -nodes -clcerts

Now you will have both the certificate and key in the cert.pem file without a password.

If you need the certificate and key in separate files, use this:

openssl pkcs12 -in cert.p12 -out cert.pem -clcerts -nokeys
openssl pkcs12 -in cert.p12 -out key.pem -nocerts -nodes
Dipin Krishna

Written by Dipin Krishna

Senior full-stack engineer with 15 years across Django, Laravel, SwiftUI and the infrastructure underneath. Available for contract work.

Work with me →

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.