Convert .cer to .p12

IosMacosCertificateKeystore AccessP12

Ios Problem Overview


I'm working on a project for a client. 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.

ui

Alternatively 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?

Ios Solutions


Solution 1 - Ios

What works for me dealing with Push Notification certifies has been:

  1. Open the certificate: open my_filename.cer and click "View Certificates" to see the certificate's name
  2. Go to Applications -> Utilities -> Keychain Access
  3. Ensure you have selected the "login" keychain, not the "system" one (thanks to @Matt Flettcher )
  4. Go to "Certificates"
  5. Look for the desired certificate
  6. Ensure that you can expand it and see under it the original ".certSigningRequest" used to generate the certificate
  7. At this moment you should be able to export it as ".p12"

Solution 2 - Ios

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:

https://stackoverflow.com/questions/1453286/aps-developer-identity-cer-to-p12-without-having-to-export-from-key-chain?noredirect=1&lq=1

https://stackoverflow.com/questions/21141215/creating-a-p12-file

Solution 3 - Ios

I had the same problem. .p12 Export was not available, only .p7b

I solved it very easily:

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.

Good Luck!

Solution 4 - Ios

You should select both cert and private key. Then you will able to export certs with p12 extension.

Solution 5 - Ios

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 even I'm doing right. So then tried with the below one command instead of few others:

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/

I'm newbie to SSL & certs stuff & can't judge on other answers,appreciate everyone's work here!!

Solution 6 - Ios

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMichael SchwartzView Question on Stackoverflow
Solution 1 - IosbuguibuView Answer on Stackoverflow
Solution 2 - IosLaBUBUView Answer on Stackoverflow
Solution 3 - IosStefan IhmigView Answer on Stackoverflow
Solution 4 - Iosmatteo2191View Answer on Stackoverflow
Solution 5 - Ioswhoami - fakeFaceTrueSoulView Answer on Stackoverflow
Solution 6 - IosDenis CherniatevView Answer on Stackoverflow