SuperSigner

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. 1

    Look at what the file starts with

    Open Terminal and run grep -e -----BEGIN yourfile.pem with 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 as RSA PRIVATE KEY or EC 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. 2

    Test a binary file with OpenSSL

    macOS has the openssl command in Terminal (on macOS 26.6.2 it is LibreSSL 3.3.6). Run openssl pkcs12 -in yourfile.p12 -info -noout and enter the file password. MAC verified OK means the file is PKCS #12 and the password is right. The private key is inside when the output also has a Shrouded Keybag line; with only a Certificate bag line, the file holds certificates without the key. If you installed OpenSSL 3 with Homebrew and the command ends with an error, run /usr/bin/openssl instead or add -legacy. For a .cer file, run openssl 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. 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. 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. 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.crt and private.key. Run openssl 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.pem to 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).

ExtensionFormatHolds the private keyTypical source
.p12PKCS #12, binary, password-protected (RFC 7292)yes, with the certificate and often its chainexport from Keychain Access, certificate authorities
.pfxthe same PKCS #12 formatyesWindows: Personal Information Exchange - PKCS #12 (.PFX) in the Certificate Export Wizard
.cerX.509 certificate (RFC 5280), usually binary DER, sometimes textnocertificate authority download, Keychain Access export as Certificate (.cer)
.crtX.509 certificate, the extension RFC 7468 recommends for the text formnocertificate authorities, servers, OpenSSL
.pemtext with -----BEGIN …----- labelsonly if it has a PRIVATE KEY blockservers, OpenSSL, Keychain Access export as Privacy Enhanced Mail (.pem)
.keyprivate key on its own, usually PEM textyes, without the certificateOpenSSL, server certificate requests
.p7bPKCS #7 certificate bundleno, certificates onlycertificate 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.

Sources

Try SuperSigner for free

3 signatures with every feature unlocked. PostSignum, I.CA and any .p12/.pfx certificate, signed PDF with a timestamp.

The SuperSigner window: a PDF with the signature stamp placed and the certificate selected
This is what signing looks like in SuperSigner: open the PDF, pick the certificate, place the stamp.
Download for Apple Silicon

Version 2.0 · macOS 12+ · 40 MB Need the Intel build instead?

Signed with an Apple Developer ID and notarized: Apple checked the app for malware.

Pricing and what the license includes