iOS - Creating a Distribution Certificate and .p12

Gobi R
4 min readAug 30, 2021

--

A distribution certificate identifies your team/organization within a distribution provisioning profile and allows you to submit your app to the App Store.

A .p12 file contains the certificates App Store Connect needs in order to build and publish apps.

The steps below will guide you through the process of creating an iOS Distribution Certificate and .p12 file.

Create a Distribution Certificate

i. On your Mac go to the folder Applications > Utilities and open Keychain Access.

ii. Go to Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority.

iii. Fill out the information in the Certificate Information window as specified below and click “Continue.”

  • In the User Email Address field, enter the email address to identify with this certificate
  • In the Common Name field, enter your name
  • In the Request group, click the “Saved to disk” option

IV. Save the file to your hard drive.

The assistant creates a Certificate Signing Request (CSR) file which contains a public/private key pair.

V. To login into the iOS Developer Console and click Account at the top

VI. Click “Certificates, Identifiers & Profiles.”

VII. Go to Certificates and click on the “+” button to add a new certificate.

VIII. Select “App Store and Ad Hoc” from the Production options and click “Continue.”

IX. Click on “Continue” again.

You created your CSR file in the previous steps, so there’s no need to create another one.

X. Click on “Choose File” and select the CSR file you created previously and then click on “Continue.”

XI. Click on the “Download” button to download a .cer file to your machine and then click “Done.”

XII. Double-click the .cer file to install it in Keychain Access.

It will have the name “iPhone Distribution <firstname> <lastname>” and will expire one year from today’s date.

How to Export a Distribution Certificate as a .p12 File

A .p12 file is a specially-formatted and encrypted file that contains your distribution certificate. iTunes Connect checks for this file when you submit an app and will only accept the app if it contains a .p12 file that matches what you have configured in your iTunes Connect account.

1. On your Mac, launch Keychain Access, select the certificate entry and right-click on it to select “Export.”

All certificates you have installed will be in the “login” keychain under the category “My Certificates”.

2. In the window that appears, make sure the File Format is set to “Personal Information Exchange (.p12)” and click on “Save” to save it to your machine.

3. When asked for a password, leave it blank and click on “Ok.”

4. When asked for the computer password, enter it and click on “Allow.”

5. Your .p12 file will be saved in the location you specified.

App Creation: Next Steps

Creating distribution certificates and .p12 files is only one step in creating an iOS app for distribution.

Was this article helpful?

--

--