OpenSSL cert conversion
Convert PFX to PEM
openssl pkcs12 -in certificate.pfx -out certificate.cer -nodesConvert PEM to PFX
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt Convert P7B to PEM
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cerConvert P7B to PFX
# Step 1
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer
# Step 2
openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer
openssl pkcs7 -print_certs -in old.p7b -out new.crtConvert DER to PEM
openssl x509 -inform der -in certificate.cer -out certificate.pemConvert DER to CRT
Use the following command to convert a DER encoded certificate into a PEM encoded certificate:
openssl x509 -inform DER -in yourdomain.der -outform PEM -out yourdomain.crtUse the following command to convert a DER encoded private key into a PEM encoded private key:
openssl rsa -inform DER -in yourdomain_key.der -outform PEM -out yourdomain.keyConvert CER to PEM
openssl x509 -in cert.cer -out cert.pem
Convert PEM to DERConvert PEM to DER
openssl x509 -outform der -in certificate.pem -out certificate.derConvert CRT to DER
Use the following command to convert a PEM encoded certificate into a DER encoded certificate:
openssl x509 -inform PEM -in yourdomain.crt -outform DER -out yourdomain.derUse the following command to convert a PEM encoded private key into a DER encoded private key:
openssl rsa -inform PEM -in yourdomain.key -outform DER -out yourdomain_key.derConvert PEM to P7B
openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer Convert CRT to PEM
openssl x509 -inform DER -outform PEM -in my_certificate.crt -out my_certificate.pemPEM format:
openssl rsa -inform PEM -in /tmp/ssl.keyCheck to see if your Certificate is in PEM format:
openssl x509 -inform PEM -in /tmp/certificate.crtLast updated