How to create P12 certificate for iOS distribution
We have an iOS app whose push notification cert has expired and we’re trying to create a new one. I’ve created new certs in the Provisioning portal (ios_developer.cer, ios_distribution.cer) and downloaded them. I was following instructions here on Stack Overflow to convert it to PEM and then to P12 files, but I’m stuck. When I then attempt to convert the PEM to P12, it wants a private key of some sort, and I don’t know where to get it.
I’ve also tried loading these into Keychain Access. I had read that you could export them as P12 from there, but when I do the Import, they don’t appear anywhere.
- Which certificate should I use to sign my Mac OS X application?
- iOS Provisioning and Certifcates - Will Revoke/Renew effect App Store Apps?
- What is the reason of kSecTrustResultRecoverableTrustFailure?
- iPhone Developer' doesn't match any valid, non-expired certificate/private key pair-BUT I'm creating and Ipad app
- No iOS Development certificates found
- How can I deploy an iPhone application from Xcode to a real iPhone device?
5 Solutions Collect From Internet About “How to create P12 certificate for iOS distribution”
Your private key is generated when you created the signing request in Keychain Access. After the cert is generated and downloaded, double-clicking it will add it to Keychain Access where it will be matched up with the private key. You can then select the cert, and open the arrow to also select the private key and export them together as a .p12 file from Keychain Access.
.p12 files are used to publish app on the Apple App Store
A. Create a (.certSigningRequest) CSR file
- Open Keychain Access from Utilities
- From Keychain Access toolbar select Keychain Access -> Preference
- In the pop up window select Certificates tab
- Set both “Online Certificate Status Protocol” and “Certificate Revocation List” to “Off”
- Close this window
- Now from toolbar, open Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority
- Enter email address and common name that you used to register in the iOS Developer Program
- Keep CA Email blank and select “Saved to disk” and “Let me specify key pair information”
- Click Continue
- Choose a filename & destination on your hard drive
- Click Save
- In the next window, set “Key Size” value to “2048 bits”
- Set “Algorithm” to “RSA”
- Click Continue
This will create and save your certSigningRequest file (CSR) to your hard drive. A public and private key will also be created in Keychain Access with the Common Name entered.
B. Create “.cer” file in iOS developer account
- Login to apple developer account Click “Certificates, Identifiers & Profiles”
- Click “Provisioning Profiles”
- In the “Certificates” section click “Production”
- Click the “Add” (+) button at the top-right of the main panel
- Now, choose “App Store and Ad Hoc”
- Click Continue
- Click “Choose File” & find CSR file you’ve made from your hard drive
- Click Generate
- Click Download to get the file
C. Install .cer and generate .p12 certificate
- Find .cer file you’ve downloaded and double-click
- Set Login drop-down to “login” and Click Add
- Open up KeyChain Access and you’ll find profile created in Step A
- You can expand “private key” profile (shows certificate you added)
- Select only these two items (not the public key)
- Right click and click “Export 2 items…” from popup
- Now make sure file format is “.p12” and choose filename and destination on your hard drive
- Click Save. Now, you’ll be prompted to set a password but keep these both blank
- Click OK. Now, you have a .p12 file on your hard drive
OK, problem solved! it seems that when i double click on the certificate, it automatically installs it in the SYSTEM keychain – i don’t know why. So instead, i simply drag and drop the certificate into the LOGIN keychain and then all is good. Thanks to this article -> Adding certificates to keychain and generating .p12 file format – alon rosenfeld 10 months ago
you will not get the expand option unless you filter by choosing (Certificates) from key chain left bottom corner
For anyone still having this issue, the solution for me was to NOT select both and “Export 2 items” (the key and the certificate) – rather just export the certificate which ALREADY includes the key. As of 2016 i think this is the way to do it because previous uploads that worked with the export 2 items no longer work.
- Remove selection gray shadow from html input on iOS
- Exit Code 1 Error after building iOS Application
- iOS Colors Incorrect When Saving Animated Gif
- Forcing iPhone Microphone as Audio Input
- Convert array to JSON string in swift
- How to add description to the UITableView
- Decoding H264 VideoToolkit API fails with Error -8971 in VTDecompressionSessionCreate
- What is the simplest way to retrieve the device serial number of an iOS device using MonoTouch?
- Objective-c: How to round off Float values?
- Open WhatsApp conversation using Abid doesn't work
- What types of dates are these?
- UIViewPropertyAnimator does not update the view when expected
- What's the best way to ensure a UITableView reloads atomically?
- Can you save the position of a node in an sks file
- How to fix blurred text on an iPhone 6 (+)