convert p12 to pem 1

convert p12 to pem

openssl pkcs12 -in mycert.p12 -out ca.pem -cacerts -nokeys
openssl pkcs12 -in mycert.p12 -out client.pem -clcerts -nokeys 
openssl pkcs12 -in mycert.p12 -out key.pem -nocerts

Here is what the above code is Doing:
1. Create a self-signed certificate for the CA.
2. Create a certificate request for the server.
3. Sign the server certificate request with the CA certificate.
4. Create a certificate request for the client.
5. Sign the client certificate request with the CA certificate.
6. Create a PKCS12 file containing the server certificate, the client certificate, and the CA certificate.
7. Extract the CA certificate from the PKCS12 file.
8. Extract the client certificate from the PKCS12 file.
9. Extract the private key from the PKCS12 file.

Similar Posts