Conversion of Format in Digital Certificates

By
Darío Rivera
Posted On
in
OpenSSL
Each format in openssl for certificates is intended for a different purpose. With openssl, you can perform the conversion from one format to another for each of these purposes. Below you will see which commands are useful for converting digital certificates based on the x509 standard.
.PEM to .DER
openssl x509 -inform PEM -outform DER -in certificate.pem -out certificate.der
.PEM to .PB7
openssl crl2pkcs7 -nocrl -certfile certificate.pem -out certificate.p7b
.PEM to .PFX
openssl pkcs12 -export -inkey private.key -in certificate.pem -out certificate.pfx
.DER to .PEM
openssl x509 -inform DER -outform PEM -in certificate.der -out certificate.pem
.P7B to .PEM
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.pem
.PFX to .PEM
openssl pkcs12 -in certificate.pfx -out certificate.pem -nodes