PEM from and to P12

Convert between PEM and P12 PEM It 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…


Convert between PEM and P12

PEM
It 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:

[code lang=”bash”]
openssl pkcs12 -export -in usercert.pem -inkey userkey.pem -out bundle.p12
[/code]

P12 to PEM

[code lang=”bash”]
openssl pkcs12 -in bundle.p12 -out userkey.pem -nodes -clcerts
[/code]

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


Leave a Reply

Discover more from Prabhu System Technology

Subscribe now to keep reading and get access to the full archive.

Continue reading