Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert .cer to .p12

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?

like image 704
Michael Schwartz Avatar asked Aug 23 '16 01:08

Michael Schwartz


People also ask

How do I make a p12 file from CER?

From the Keychain Access menu in the header, go to File then select Export Items. For File Format, select Personal Information Exchange (. p12). Enter a name for the file in the Save As: field, and click Save.


4 Answers

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"
like image 129
buguibu Avatar answered Sep 26 '22 23:09

buguibu


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?

Creating a .p12 file

like image 45
LaBUBU Avatar answered Sep 22 '22 23:09

LaBUBU


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!

like image 35
Stefan Ihmig Avatar answered Sep 25 '22 23:09

Stefan Ihmig


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

like image 25
matteo2191 Avatar answered Sep 24 '22 23:09

matteo2191