Guide for Mac

How to install a digital certificate on a Mac and verify it works with the AEAT

Learn how to install a digital certificate on your Mac step by step, check that it works correctly with the Tax Agency (AEAT), troubleshoot common errors and find out which type of certificate you need for online procedures.

A digital certificate is an essential tool for carrying out online procedures with public administrations: filing taxes, checking notifications, accessing Social Security, signing documents, managing self‑employed procedures or acting on behalf of a company.

In this guide I explain how to install a digital certificate on a Mac, how to check it works with the AEAT and what to do if the browser doesn’t recognise it or errors appear when trying to access.

Quick infographic: process for installing a digital certificate on a Mac

This is the visual summary of the process: first install the certificate in Keychain Access, then verify it appears correctly and, finally, test access on the AEAT Electronic Office.

Infografía paso a paso sobre cómo instalar un certificado digital en Mac y comprobarlo en la AEAT

Visual guide to installing, checking and troubleshooting common digital certificate errors on Mac.

What a digital certificate is and what it’s for

A digital certificate allows you to identify yourself securely online. It works like a sort of electronic ID card installed on your computer, browser or device.

With it you can:

  • Access the AEAT Electronic Office.
  • Submit tax returns and forms.
  • Check electronic notifications.
  • Sign documents digitally.
  • Carry out procedures with Social Security, local councils and other public bodies.
  • Act as a representative of a company or entity, if you have the appropriate certificate.

Most common types of digital certificates

Before installing it, it’s helpful to know which type of certificate you have or will need.

Personal (individual) certificate

It’s the most common certificate. It identifies a specific person and allows them to carry out personal procedures with public bodies.

It’s typically used by self‑employed people, private individuals and professionals to access the Tax Agency, Social Security or electronic offices.

Representative certificate

Used to act on behalf of a company, corporation, association or other entity.

Common among company directors, accountancy firms, tax advisers and businesses that need to file taxes or sign documents online.

Electronic seal certificate

Mainly used for automated or administrative processes within companies and organisations.

It doesn’t identify a natural person, but an entity that needs to sign documents or communications automatically.

Requirements before installing the digital certificate on Mac

1. Have the certificate file

It will usually be a file with the extension .p12 or .pfx.

This file is usually protected with a password. You’ll need it during the installation.

2. Use a compatible browser

On Mac you can use Safari, Firefox or Chrome, although some specific procedures may work better in one browser than another.

3. Install AutoFirma if you’re going to sign documents

For many administrative procedures accessing with a certificate is not enough. You may also need to sign documents electronically.

In those cases the app typically used is AutoFirma, the official signing application used by many public electronic offices.

How to install a digital certificate on Mac, step by step

To install a digital certificate on macOS, the usual process is to import it into the app Keychain Access.

Step 1: Open Keychain Access

Go to Applications > Utilities > Keychain Access.

You can also open Spotlight with Cmd + Space and search for “Keychain Access”.

Step 2: Select the correct keychain

On the left-hand side, select login.

Then go to the category My Certificates.

Step 3: Import the certificate file

From the top menu, go to File > Import Items.

Select the file .p12 or .pfx of your digital certificate.

Step 4: Enter the password

macOS will ask for the certificate’s password.

It’s the password set when it was exported or when the backup was created.

Once entered, the certificate should appear in My Certificates.

Step 5: Check it appears correctly

Inside Keychain Access, look for your name or the name of the issuing entity.

If the certificate has been installed correctly, you should see it accompanied by its private key. This is important: if the private key doesn’t appear, the certificate may not work for identification or signing.

How to install the digital certificate in Firefox on Mac

Firefox manages its certificates independently. This means that even if you’ve installed the certificate in the macOS keychain, Firefox may not detect it automatically.

To import it into Firefox:

  1. Open Firefox.
  2. Go to Settings or Preferences.
  3. Go to Privacy & Security.
  4. Scroll down to the Certificates.
  5. Click on View Certificates.
  6. In the Your Certificates, Import.
  7. Select the file .p12 or .pfx.
  8. Enter the certificate’s password.

How to check if the certificate works on the AEAT

Once the certificate is installed, the best practice is to test it on the Tax Agency's Electronic Office (AEAT).

Step 1: Go to the AEAT Electronic Office

Access the official Electronic Office of the Tax Agency.

Step 2: Open a procedure that allows access by certificate

Look for any procedure that lets you identify yourself with a digital certificate, for example a tax query, a notification or filing a form.

Step 3: Select the certificate

When the browser prompts you, choose your digital certificate.

If everything is installed correctly, you will be able to access the procedure using your electronic identity.

Step 4: Check that the details are correct

Once inside, check that the name, NIF (tax ID) or representation details are as expected.

If a different certificate appears, none appears or access fails, check the common errors I explain below.

Common problems when installing a digital certificate on Mac

Errors with digital certificates on Mac are quite common. These are the most frequent.

The certificate does not appear in Safari

Safari uses the macOS keychain. If it doesn't appear, check the following:

  • That the certificate is installed in login.
  • That it is inside My Certificates.
  • That the imported file is .p12 or .pfx.
  • That the password is correct.
  • That the certificate includes a private key.

You can also quit Safari and reopen it after importing the certificate.

Firefox does not recognise the certificate

Firefox may not automatically read the Mac keychain. In that case, import the certificate directly from:

Firefox > Settings > Privacy & Security > Certificates > View Certificates > Import

The certificate appears, but it doesn't allow access to the AEAT

This can happen for several reasons:

  • The certificate has expired.
  • The certificate has been revoked.
  • The browser has cookies or pop‑ups blocked.
  • The certificate does not have a private key.
  • The electronic office requires AutoFirma to complete the procedure.
  • There are several certificates installed and the wrong one is being selected.

Try a different browser, restart the Mac and check that the system date and time are correct.

Secure connection error

If a secure connection error appears, check:

  • The Mac’s date and time.
  • That the browser is up to date.
  • That there are no extensions blocking the electronic office.
  • That you are accessing the administration's official website.
  • That the root certificate is correctly installed.

The certificate has expired

Digital certificates have an expiry date.

If it has expired, you will need to renew it or request a new one from the issuing authority.

It’s recommended to renew it before it expires, because once expired some procedures may no longer allow online renewal.

AutoFirma doesn't detect the certificate

If the problem appears when signing, not when accessing, it may be related to AutoFirma.

Check the following:

  • That AutoFirma is installed.
  • That you have the version compatible with your macOS.
  • That the certificate is correctly installed.
  • That the browser allows AutoFirma to open.
  • That no pop‑up blockers are interfering.

Useful commands to manage certificates on Mac

If you have advanced knowledge, you can inspect some certificates from the Terminal.

List available identities

security find-identity -v

Search for installed certificates

security find-certificate -a

Delete a certificate by name

security delete-certificate -c "Certificate Name"

Be careful when deleting certificates. If you’re not sure, it’s better to make a backup first or ask for help.

Important tips before using your digital certificate

To avoid problems, keep the following recommendations in mind:

  • Always keep a backup copy of the certificate.
  • Do not share the file .p12 or .pfx with anyone.
  • Protect the backup with a strong password.
  • Do not install your certificate on public computers.
  • Check the expiry date.
  • Keep macOS, your browser and AutoFirma up to date.
  • Verify the certificate before carrying out an urgent procedure.

Frequently asked questions about digital certificates on Mac

Can I use the digital certificate in Safari?

Yes. Safari uses the macOS keychain, so usually it’s enough to install the certificate in Keychain Access.

Why doesn’t Firefox detect my digital certificate?

Because Firefox may manage its certificates independently. In many cases you’ll need to import it manually from the browser’s certificate settings.

What format should the certificate have?

The most common formats to import certificates on Mac are .p12 and .pfx.

Do I need AutoFirma to use the digital certificate?

Not always. To identify yourself on an electronic office the certificate may be enough. However, to sign applications, forms or documents many services require AutoFirma.

How do I know if my certificate is properly installed?

You can check by entering an electronic office, such as the Tax Agency's, and selecting access via digital certificate.

Can I install the same certificate on multiple devices?

Yes, provided you have an exported copy of the certificate with its private key and the corresponding password. Still, you should store it securely and avoid installing it on devices you do not control.

Do you need help installing your digital certificate on Mac?

Installing a digital certificate on Mac may seem straightforward, but when errors occur with Safari, Firefox, AutoFirma or the AEAT the process can become frustrating.

If you cannot get your certificate to work, at DanielGontan.es we can help you online via remote connection with TeamViewer.

We’ll check the installation, the browser, AutoFirma and access to the electronic office with you so you can carry out your procedures without wasting any more time.

Contact us and we’ll help you get your digital certificate working correctly on your Mac.

Request a diagnosis
1