8

How can I export the private key embedded in an .cer file and convert it to .pem using openssl.

Update:

If I download a .cer file from Apple and import it into KeyChain, I can export the private key as a .p12 file. How can I do this using openssl?

alt text
(source: flickr.com)

alt text
(source: flickr.com)

2
  • 2
    So what might be going on is that when I generate the CSR Keychain stores the private key and just pairs it with the .cer when it's imported. Which is why they would appear to be linked together.
    – user79854
    Commented May 29, 2009 at 1:05
  • 1
    how did you solve this problem? I have the exact problem. I also generated the CSR file using openssl, but when I get the .cer file from apple, it doesn't have the private key inside.
    – mor222
    Commented Apr 25, 2018 at 10:23

1 Answer 1

15

Unfortunately - the certificate does not contain the private key (it does, however contain the public key). You'll need the private key source (a .p12 usually), to extract the private key.

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.