# Create iOS Distribution Certificate

This article explains:

* [How to create an iOS Distribution Certificate.](#how-to-create-an-ios-distribution-certificate)
* [How to export an iOS Distribution Certificate as a .p12 file.](#how-to-export-an-ios-distribution-certificate-as-a-.p12-file)

### How to create a new iOS Distribution Certificate

1. Navigate to <https://developer.apple.com/account> and **login with your Apple Developer account**.<br>
2. **Open the Certificates section** and click the blue **+ button** at the top of the page to **create a new certificate**.<br>

   <figure><img src="https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FA7sBrZ0N0V57Yn8KioYd%2FPasted_Image_11_01_2023__19_33.png?alt=media&#x26;token=ccb363c2-be73-4a21-88c3-a00ab8bdb78f" alt=""><figcaption><p>Apple Developer Portal - Certificates</p></figcaption></figure>
3. **Select** the option **In-House and Ad Hoc** and click Continue.<br>

   <figure><img src="https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FOcYqAik7sVsV78R3J5Y0%2FPasted_Image_11_01_2023__19_36.png?alt=media&#x26;token=4e3fd739-39c3-4ee9-8a89-ebe70b4e1ac6" alt=""><figcaption><p>Apple Developer Portal - Create new certificate</p></figcaption></figure>
4. **Upload** the **Certificate Signing Request** file and click Continue.\
   \
   \&#xNAN;***Note:** You can obtain the Certificate Signing Request (.csr) file from AppMachine by following steps 1-3 in* [*this article*](https://docs.appmachine.com/share-your-app/apple-app-store/enterprise/setup-your-enterprise-app)*. At step 3, choose the option to create a new certificate.*<br>

   <figure><img src="https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FGrVvNA6xy9ulzWLIvXXV%2FPasted_Image_11_01_2023__19_38.png?alt=media&#x26;token=2f7f1a6c-8686-48fc-8ac4-940f336ee168" alt=""><figcaption><p>Apple Developer Portal - Upload .csr file</p></figcaption></figure>
5. **Download** the Certificate (.cer) file from the Apple Developer Portal. \
   \
   \&#xNAN;***Note:** If you're a MacOS user then you can double click the certificate file to add the certificate and its private key (.csr file) to Keychain Access, from which you can export both files as a single .p12 certificate for re-use.* [*Learn more..*](#how-to-export-an-ios-distribution-certificate-as-a-.p12-file)<br>

   <figure><img src="https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2Fi7hYCPI22Llo40mJkM9d%2FPasted_Image_11_01_2023__22_51.png?alt=media&#x26;token=7874e2d8-a837-49b2-b38d-ced70aadf73a" alt=""><figcaption><p>Apple Developer Portal - Download .cer file</p></figcaption></figure>
6. After downloading the certificate (.cer) file, you can [**follow the steps in this article to link the iOS Distribution Certificate to your AppMachine app**](https://docs.appmachine.com/share-your-app/apple-app-store/enterprise/setup-your-enterprise-app).

### How to export an iOS Distribution Certificate as a .p12 file

The following steps assume that you are in possession of the iOS Distribution Certificate and its private key, and that you're using a MacOS system with the Keychain Access app installed and accessible.

1. **Open Keychain Access** on your MacOS machine.
2. **Locate the certificate** you wish to export as a .p12 file.\
   \
   \&#xNAN;***Note:** The default location for certificates is the My Certificates tab of the Login keychain.*<br>
3. **Select both the certificate and its private key**, which is nested under the certificate, then **right-click** on your selection and click on **Export 2 items**.\
   \
   \&#xNAN;***Note:** Your certificate cannot be used by others without the private key. If the private key is not available in Keychain Access, then it is likely not on your machine at all. In that case you can either contact people in your organisation to obtain the private key, or create a new distribution certificate instead.*<br>

   <figure><img src="https://2636455530-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wzy1sO41plYrfJfaAhN%2Fuploads%2FEAqGsu5cIRIty8hX5ecK%2FPasted_Image_11_01_2023__23_12.png?alt=media&#x26;token=48d02cb5-58a2-414d-b450-681ebf5330a4" alt=""><figcaption><p>Keychain Access - Export Distribution Certificate</p></figcaption></figure>
4. **Enter a name** for the file and **click Save**. The exported items will be saved as a single Personal Information Exchange (.p12) file. <br>
5. After saving the file you will be prompted to **enter a password** for the file. Store the file and its password in a safe place.<br>
6. Now that you've exported the iOS Distribution Certificate and its private key as a .p12 file, you can [**follow the steps in this article to link the exported iOS Distribution Certificate (.p12) to your AppMachine app**](https://docs.appmachine.com/share-your-app/apple-app-store/enterprise/setup-your-enterprise-app).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appmachine.com/share-your-app/apple-app-store/enterprise/create-ios-distribution-certificate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
