P12 vs PFX vs PEM vs CER: which certificate file signs a PDF
.p12 and .pfx are the same format, PKCS #12: one password-protected file with your certificate and its private key. That is the file you need to sign a PDF on a Mac. A .cer, .crt or .pem file usually holds only the certificate, which lets others check your signatures but can’t make one, unless you also have the private key in a separate .key or .pem file.
Steps: find out what your file holds and get a .p12
-
1
Look at what the file starts with
Open Terminal and run
grep -e -----BEGIN yourfile.pemwith your file name. A text file in PEM format has one label line for each block it holds (RFC 7468):-----BEGIN CERTIFICATE-----is a certificate,-----BEGIN PRIVATE KEY-----or-----BEGIN ENCRYPTED PRIVATE KEY-----is a private key, and OpenSSL also writes keys asRSA PRIVATE KEYorEC PRIVATE KEY. A file with both kinds of lines holds both. If the command prints nothing, the file is binary: either a .p12/.pfx or a certificate in DER, the binary form most .cer files use. -
2
Test a binary file with OpenSSL
macOS has the
opensslcommand in Terminal (on macOS 26.6.2 it is LibreSSL 3.3.6). Runopenssl pkcs12 -in yourfile.p12 -info -nooutand enter the file password.MAC verified OKmeans the file is PKCS #12 and the password is right. The private key is inside when the output also has aShrouded Keybagline; with only aCertificate bagline, the file holds certificates without the key. If you installed OpenSSL 3 with Homebrew and the command ends with an error, run/usr/bin/opensslinstead or add-legacy. For a .cer file, runopenssl x509 -in yourfile.cer -inform der -noout -subject -enddate: it prints whose certificate it is and when it expires, which also tells you it holds no key. For a text certificate, leave out-inform der. -
3
If you have a .p12 or .pfx file, you’re done
Both extensions are the same PKCS #12 format. RFC 7292 calls its top-level structure PFX and says the acronym is sometimes expanded as Personal Information Exchange; Windows saves it as .pfx, Keychain Access on a Mac as .p12. You don’t need to convert anything, and renaming .pfx to .p12 changes nothing inside the file. If you also want the certificate in Keychain Access, for example for Apple Mail, see how to import a .p12 file on a Mac.
-
4
If you have only a .cer or .crt file, find the private key
The certificate authority sends the certificate, but the private key was created on your side, on the computer or card where you made the request. If that was a Mac, the key is in Keychain Access under My Certificates, and you export both together as a .p12 file (steps in the signing guide). If the key is on a smart card or a USB token, it can’t be exported at all.
-
5
If you have a certificate and a separate key, combine them
Certificates made for servers or with OpenSSL often come as two files, for example
certificate.crtandprivate.key. Runopenssl pkcs12 -export -in certificate.crt -inkey private.key -out certificate.p12. OpenSSL asks for the key’s pass phrase, if it has one, and then for a new password for the .p12 file. If your provider sent the issuer certificates in a separate file, add-certfile chain.pemto put the chain into the .p12 as well.
The file types compared
A .pem or .cer file can hold different things, so check it with step 1 when in doubt. The Keychain Access formats in the table are the four its export offers on macOS 26.6.2 (checked November 23, 2026).
| Extension | Format | Holds the private key | Typical source |
|---|---|---|---|
| .p12 | PKCS #12, binary, password-protected (RFC 7292) | yes, with the certificate and often its chain | export from Keychain Access, certificate authorities |
| .pfx | the same PKCS #12 format | yes | Windows: Personal Information Exchange - PKCS #12 (.PFX) in the Certificate Export Wizard |
| .cer | X.509 certificate (RFC 5280), usually binary DER, sometimes text | no | certificate authority download, Keychain Access export as Certificate (.cer) |
| .crt | X.509 certificate, the extension RFC 7468 recommends for the text form | no | certificate authorities, servers, OpenSSL |
| .pem | text with -----BEGIN …----- labels | only if it has a PRIVATE KEY block | servers, OpenSSL, Keychain Access export as Privacy Enhanced Mail (.pem) |
| .key | private key on its own, usually PEM text | yes, without the certificate | OpenSSL, server certificate requests |
| .p7b | PKCS #7 certificate bundle | no, certificates only | certificate chains, Keychain Access export as Certificate Bundle (.p7b) |
Which file to send to whom
Never send a .p12, .pfx or .key file, or a .pem file with a PRIVATE KEY block: with it and its password, anyone can sign in your name. A .cer or a certificate-only .pem file is public and safe to share. For checking your signatures, people usually don’t need even that, because the signed PDF carries your certificate inside the signature.
The file type also doesn’t decide the legal level of the signature. Under the eIDAS Regulation, a qualified certificate in a .p12 file can give an advanced electronic signature based on a qualified certificate. For a qualified electronic signature, the key has to be on a qualified device such as a smart card or token, or with a qualified remote signing service. What kind of certificate to get is in How to get a digital signature certificate.
Converting a .p12 file back to PEM
Some servers and tools want the certificate and the key as separate text files. openssl pkcs12 -in certificate.p12 -nokeys -out certificate.pem writes the certificates, and openssl pkcs12 -in certificate.p12 -nocerts -out private.key writes the private key, encrypted with a new pass phrase that OpenSSL asks for. Both commands first ask for the .p12 password. Delete the key file once you don’t need it.
When you don’t need SuperSigner
If you sign a few PDFs a year, the free Adobe Acrobat Reader can use your .p12 file as a digital ID (how to add it). Converting between formats needs only the openssl command that comes with macOS. SuperSigner is worth it when you sign PDFs on a Mac regularly and want the stamp on the page in a few clicks.
Which files SuperSigner accepts
In the Certificate card, Choose takes a .p12 or .pfx file, or a .crt, .cer or .pem certificate in text or binary form. With a certificate on its own, the app asks for the Private key (.pem, .key) as a second file, encrypted or not. A .p7b bundle can’t be used, because it has no key. We checked all of these on November 23, 2026 by signing a test PDF with each. Three signatures are free, then a license costs 1,490 CZK once (about €61 or $69 at the Czech National Bank rate of November 10, 2026).
Frequently asked questions
Is there any difference between .p12 and .pfx?
No, both are PKCS #12. Only the extension differs: Windows uses .pfx, macOS Keychain Access uses .p12.
Can I sign a PDF with a .cer file?
No. A .cer file holds only the certificate with the public key. Signing needs the private key, so you need a .p12 or .pfx file, or the certificate plus a .key file.
What password does a .p12 file have?
The one set when the file was made: by you when you exported it from Keychain Access or OpenSSL, or by the provider if it sent you the file. It isn’t your Mac password unless you chose the same one.
Is a .pem file a certificate or a key?
It can be either, or both. Look at the label lines: CERTIFICATE is the certificate, PRIVATE KEY or ENCRYPTED PRIVATE KEY is the key.
Do I need to convert .pfx to .p12 for my Mac?
No, there is nothing to convert. If an app’s file dialog offers only .p12, renaming the file is enough; SuperSigner opens either extension.
Related guides
- How to sign a PDF with a digital certificate on a Mac Sign a PDF with your own certificate on macOS: export it from Keychain Access as .p12, pick it in the signing app, place the stamp and check the result in Acrobat Reader.
- How to get a digital signature certificate for signing PDFs Where to get a certificate for signing PDFs: a qualified provider on the EU Trusted List, an AATL member, your employer or a free self-signed one, and which work as a .p12 file.
- Acrobat on Mac doesn’t show your certificate: how to fix it Your certificate is in Keychain Access, but Acrobat on a Mac doesn’t offer it for signing. Export it as a .p12 file with its key and add it as a digital ID.
Sources
- RFC 7292: PKCS #12, Personal Information Exchange Syntax v1.1
- RFC 7468: Textual Encodings of PKIX, PKCS, and CMS Structures (labels, .crt and .cer)
- RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile
- Microsoft Learn: Export a certificate with its private key in Windows Server
- Apple: Import and export keychain items using Keychain Access on Mac
- OpenSSL: pkcs12 command
- Regulation (EU) No 910/2014 (eIDAS), consolidated text: Articles 3, 26 and 27
- Adobe: Register digital IDs in Acrobat
- Czech National Bank: exchange rates, November 10, 2026