DNIe for Mac

Help

How to export a digital certificate from a Mac

Guide updated: · by nexoapex

To export an FNMT digital certificate on a Mac, open Keychain Access, select your identity under login → My Certificates, and choose File → Export Items. Save a password-protected .p12 file. A DNIe card is different: its private key stays on the chip and cannot be exported.

First check that the private key is present

Look for your identity in the login keychain under My Certificates. A .cer or .crt file contains only the public certificate; it cannot sign by itself. A usable personal backup is normally a .p12 or .pfx file. If you still need to import one, follow the Mac certificate installation guide.

Export to .p12 step by step

  1. Open Keychain Access through Spotlight.
  2. Select login → My Certificates and choose your personal identity.
  3. Choose File → Export Items and select Personal Information Exchange (.p12).
  4. Choose a file name and location, click Save, and create a password for the backup.
  5. Check that the .p12 file was created before moving it to another device. Keep its password separately.

These steps follow the Spanish Tax Agency's Mac backup guide and Apple's Keychain Access instructions.

If .p12 is missing or Export Items is dimmed

Select the full identity under My Certificates rather than only its public certificate. Apple says Export Items is dimmed when at least one selected item cannot be exported. Renaming a .cer file to .p12 will not restore a missing private key. The Tax Agency says that if the certificate cannot be exported or no longer works, you need to obtain another certificate.

What if the certificate is in Firefox?

Firefox may hold your identity in a separate certificate store. Check Settings → Privacy & Security → Certificates → View Certificates → Your Certificates. If it only appears there, export the backup from Firefox, as the Tax Agency explains. To use the result in Safari or Chrome, import it into the Mac keychain.

Protect the backup; keep the DNIe separate

The .p12 file contains your identity and private key. Someone with the file and password could use them, so store the copy securely and remove temporary copies from shared folders. This guide is for software certificates. A DNIe card signs inside its chip and never exports its private key. To sign a PDF with the DNIe, use the card and a reader.