Convert certificate format with OpenSSL

Convert a PEM file to DER (crt etc)
$ openssl x509 -outform der -in certificate.pem -out certificate.crt
Convert a PKCS#12 file (.pfx .p12) containing a private key and certificates to PEM
$ openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes
Convert a PEM certificate file and a private key to PKCS#12 (.pfx .p12)
$ openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *