How to Download and Convert an Old P12 File to a New P12 File

These instructions apply to the Apple Pass certificate (P12 file) that you upload when configuring Apple Passes. To learn what this certificate is used for, see Apple Passes. Use the steps below if your P12 file fails to upload because it uses an older encryption format.

Overview

This article explains how to download an old P12 file from the Settings tab of the Pass configuration page and convert it to a new P12 file that uses a newer encryption algorithm. The conversion takes three terminal commands.

Prerequisites

  • Access to the Pass configuration page (Settings tab).
  • Access to a terminal on your system.
  • OpenSSL installed on your system.

Instructions

Step 1: Download the Old P12 File

  1. Navigate to Wallet and Passes → Passes, then select Edit Loyalty Pass under Apple Loyalty Pass or Edit Offer Pass under Apple Offer Pass, depending on which certificate you need to replace.
  2. Click the Settings tab and scroll down to iOS Certificate.
  3. Copy the download link and open it in a new tab to download the file to your system.
  4. Note the path where the old P12 file is downloaded. This path is referred to as path_to_p12 in the commands below.

Use this method if you need to replace the old file on the Pass configuration page. To generate a new P12 file instead, use the legacy method, and then follow the commands below.

Step 2: View the Certificate Password

  1. On the Pass configuration page, find the Certificate password field associated with the P12 file.
  2. Click the eye icon to reveal the password.
  3. Note the password. You need it in the commands below in place of p12_cert_password.

Step 3: Convert the Old P12 File

Open a terminal and run the following commands in order.

Command 1: Decrypt the Old P12 File

openssl pkcs12 -legacy -in path_to_p12 -nodes -out cert-decrypted.tmp -password pass:p12_cert_password
  • Replace path_to_p12 with the path where the old P12 file was downloaded.
  • Replace p12_cert_password with the password from the Pass configuration page.

The response to this command should be MAC verified OK. If you see an error, run the following command instead:

openssl pkcs12 -in path_to_p12 -nodes -out cert-decrypted.tmp -password pass:p12_cert_password

Command 2: Create a New P12 File with a Newer Algorithm

openssl pkcs12 -in cert-decrypted.tmp -export -out path_to_p12 -keypbe aes-256-cbc -certpbe aes-256-cbc -password pass:p12_cert_password
  • Use the same path_to_p12 and p12_cert_password as in Command 1.

Command 3: Remove the Temporary Decrypted File

rm cert-decrypted.tmp

Your new P12 file is ready. Upload it on the Pass configuration page.