Reputation: 8425
I have two .cer files (developer and distribution) both are loaded into Keystore Access on Mac OS X. However I'm unable to export as a .p12 file.
I tried OpenSSL, but still no luck:
openssl pkcs12 -export -in followMe_ios_development.cer -out followMe_ios_development.p12 -clcerts -nokeys
How can I export this .cer file as a .p12 so I can compile this app for iOS?
Upvotes: 90
Views: 243892
Reputation: 2884
Reminder: When you are at keychain access, find the correct certificate and expand it to see its private key. Then select 2 of them together so that you can export to .p12
Upvotes: 1
Reputation: 17925
In my case I'm trying to create a pfx/PKCS12 file and have tried the given commands and ran through couple of issues out of which one was:
Unable to load certificate
So then tried with the below one command, which worked:
openssl pkcs12 -export -out requiredPFXfile.pfx -inkey yourPrivateKey.key -in yourcertificate.cer
Please find link for more details: https://www.ssl.com/how-to/create-a-pfx-p12-certificate-file-using-openssl/
Upvotes: 0
Reputation: 309
I had the same problem where a .p12 export was not available, only .p7b. I solved it this way:
You don´t select your certificate via the "certificates" directory on the lower left, but via the "My Certificates" directory.
Like this, an arrow should show up left of your certificate. Click it, and you will see your private Key.
Right-Click on your private Key and select the "export Key" option. Now you can create a .p12 Certificate File, just as the doctor ordered.
Upvotes: 20
Reputation: 81
In my case the abilty to export in p12 format depends on certificate type. For "Apple Distribution" certificate type it is disabled, right like in your case.
When I created new certificate with type "IOS Distribution (App Store and Ad Hoc)" and processed it right like previous one, the p12 format became available in export dialog.
Upvotes: 3
Reputation: 59
You should select both cert and private key. Then you will able to export certs with p12 extension.
Upvotes: 4
Reputation: 1625
What works for me dealing with Push Notification certifies has been:
open my_filename.cer
and click "View Certificates" to see the certificate's nameUpvotes: 117
Reputation: 934
try this: given you have files as follow:
aps.cer, downloaded from Apple.
app.key, your own private key generated by openssl.
1st, convert the .cer file into .pem format:
openssl x509 -in aps.cer -inform DER -out aps.pem -outform PEM
2nd, use the .pem file and your private .key to generate .p12 file:
openssl pkcs12 -export -out aps.p12 -inkey app.key -in aps.pem
this should prompt to ask a password for this .p12 file.
CF:
aps_developer_identity.cer to p12 without having to export from Key Chain?
Upvotes: 90