Monday, January 25, 2010

PEM from/to P12

I commonly need to convert between PEM and p12

PEM
Is an ASCII format and can be opened with a text editor. It is used by most SSL-based tools. Key and certificate are two separate files.
p12
Acutally: Pkcs12 is used by most browsers. Key and certificate are in one file.

PEM to P12

You need both the key and the certificate:

 
openssl pkcs12 -export -in usercert.pem -inkey userkey.pem -out bundle.p12

P12 to PEM

 
openssl pkcs12 -in bundle.p12 -out userkey.pem -nodes -clcerts

The resulting file contains both the key and certificate. Use a text editor to split into two files again.

4 comments:

  1. Thanks, short and straight to the point.

    ReplyDelete
  2. You can generate P12 to PEM file online here: http://www.logisticinfotech.com/blog/push-notification-p12-to-pem-online/

    They have developed very great document as well.

    ReplyDelete
  3. Mystino Casino: Enjoy a Free $1 Bonus for New Players
    Mystino Casino Review. Mystino Casino is an bk8 online casino that offers a ミスティーノ wide variety of games, from video slots ボンズ カジノ to video poker.

    ReplyDelete