.p12 files are used to publish app on the Apple App Store
A. On your Mac 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
Take a note that if issue still persists then try below step as well:
If your keychain is present in iCloud then remove all keychain content from iCloud and do new setup in iCloud This should work.