Keys & cryptography

PKCS#12 / .p12 file

A password-protected file format that bundles a certificate and its matching private key together. The standard way to move an Apple signing identity between machines.

.p12PKCS12.pfxp12 bundle

PKCS#12 is the cryptographic standard for packaging a certificate together with its matching private key in a single file, encrypted with a password. On Apple platforms the file usually has a .p12 extension; on Windows the same format is called .pfx. It is how teams share or back up an Apple Developer signing identity.

What is inside

  • The leaf certificate (Apple Development, Apple Distribution, Developer ID, etc.).
  • The private key that pairs with the certificate's public key.
  • Optionally, intermediate certificates (the WWDR generation that signed the leaf).
  • An encryption envelope keyed off the password you set at export time.

Two ways to produce one

Keychain Access
Right-click the certificate, choose Export, pick .p12, set a password. Works only on the Mac where the private key lives.
openssl
openssl pkcs12 -export -out cert.p12 -inkey key.pem -in cert.pem bundles a certificate and key from PEM files. Useful when the key was generated outside Keychain.

FAQ

Common questions about PKCS#12 / .p12 file

How do I create a .p12 from my Apple certificate?

On the Mac that holds the private key, open Keychain Access, find the certificate under My Certificates, expand it to confirm the key is attached, right-click, choose Export, pick the .p12 format, and set a strong password. If the key lives outside Keychain as PEM files, openssl pkcs12 -export does the same job.

Why is the .p12 export option greyed out in Keychain Access?

The private key is not there. Either you are looking at a certificate imported without its key (a bare .cer download), or you are in the Certificates category instead of My Certificates. A certificate with no expand arrow next to it has no key attached, and without the key no .p12 can be exported from that machine.

What is the .p12 password, and what if I forgot it?

The password is set at export time and encrypts the file itself; it is not your Mac or keychain password. There is no recovery: a .p12 with a forgotten password is unusable. If you still control a machine with the identity installed, export a fresh .p12 with a new password; otherwise revoke and reissue the certificate.

Is a .pfx file the same as a .p12?

Yes. Both are PKCS#12 containers; .pfx is simply the extension Windows tooling prefers. Renaming one to the other generally works, and openssl and most CI tools accept either.

Keep reading

Related terms

Next step

Help articles on this topic

Notice a definition that has drifted? Email support@hexsign.io and we'll update it. Browse the full glossary or jump to the help center.

Try HexSign

Know before a certificate or profile expires.

HexSign tracks every Apple certificate and provisioning profile and alerts you ahead of expiry. The Free plan covers tracking and alerts. Paid plans renew them for you.