I don’t do this often enough to fully remember all the steps and have to look it up all the time. I might as well save the steps in a place I know where to look it up for future use if needed.
.p12 files are used to publish app on the Apple App Store
On your Mac Create a (.certSigningRequest) CSR file
- Open Keychain Access from Utilities
- Now from toolbar, open Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority
- Enter email address that you used to register in the iOS Developer Program and common name
- 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.
Create “.cer” file in iOS developer account
- Login to apple developer account Click “Certificates, Identifiers & Profiles”
- Click “Provisioning Profiles”
- In the “Certificates” Click the “Add” (+) (Blue)
- 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
Install .cer and generate .p12 certificate
- Find .cer file you’ve downloaded and double-click
- Open up KeyChain Access and you’ll find profile created in Step A
- You can expand “private key” profile (shows certificate you added) small arrow next to the certificate if under the “my certificates” tab
- 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. If “.p12” is grayed out that means you did not select the certificate and the private key
- Click Save. Now, you’ll be prompted to set a password but keep these both blank
- It might prompt you for a password. At this point its asking for your admin password think sudo password
- Click OK. Now, you have a .p12 file on your hard drive