How to Create a Distribution Certificate?
A distribution certificate allows you to create an app for distribution. Before an app can be distributed, your must have a valid distribution certificate linked to a distribution provisioning profile. Each team can have only one active distribution certificate.
To create a distribution certificate, you will first need to generate a certificate request from your computer. On a Mac, you should do this by opening the Keychain Access application found in the Utilities.
Step 1. Generate a Certificate Request
Go to Keychain Access - Choose Keychain Access -> Certificate Assistant -> Request a Certificate from a Certificate Authority.
Enter your user email address and common name. Use the same address and name as you used to register in the iOS Developer Program. Select the options "saved to disk" and "let me specify key pair information" and click Continue. Specify a filename and click Save to save the file CertificateSigningRequest.certSigningRequest to your desktop.
In the following screen select '2048 bits' for the Key Size and 'RSA' for the Algorithm. Click 'Continue'.
Step 2. Request Certificate
Now go back to Apple Developer Center and click "Certificates, Identifiers & Profiles".
Next click on "Certificates" under iOS Apps
Click on the "+" sign near the top right corner to create a new certificate.
In the next screen you will need to select what type of certificate you are going to create, in this example we will be choosing the option "App Store and Ad Hoc"
Please be sure to install the WWDR intermediate certificate (Worldwide Developer Relations Certificate Authority) if you don't already have it.
If you have it installed already, this certificate will be listed in the Keychain Access Certificates section as "Apple Worldwide Developer Relations Certification Authority certificate".
If you don't have it, you'll see the error "This certificate was signed by an unknown authority" in the Keychain Access Certificates section when you try to import a distribution certificate from Apple.
After that you will see a different screen depending on the otion you chose. In this case we see a screen letting us know that in order to create the certificate we will need a certificate signing request. You have already created that in step 1.
After you click Continue, you will be asked to upload the Certificate Signing Request you generate from the first step of this tutorial. Simply upload it and click generate.
Step 3. Download Certificate
After your certificate is generated it will bring you to the download page. Click Download to save it on your computer.
After the file downloads, locate the distribution_identity.cer file in your downloads directory, and double-click it to import it to Keychain Access.
Step 4. Select Certificate
Go back to iCreateApp, click "Certificate" to select the certificate with the name beginning iPhone Distribution.