Converting SSL Certificates to PEM
SSL certificates and key files can come in a variety of forms.
- Certificates PEM, DER, PKCS7, PKCS12
- Key Files RSA, PKCS12
RSA and PEM are the most basic formats, being just text files.
You can use the openssl
program from the command line to convert between forms.
DER to PEM
openssl x509 -inform DER \
-in cert.crt \
-out cert.pem
PKCS7 to PEM
openssl pkcs7 -print_certs \
-in cert.p7b \
-out cert.pem
PKCS12 to PEM
openssl pkcs12 -clcerts -nokeys \
-in cert.pfx \
-out cert.pem
PKCS12 to RSA Key
openssl pkcs12 -nocerts -nodes \
-in cert.pfx \
-out cert.key
Written by Aaron Peschel
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#