Convert Certificate to PEM format

x.509 digital certificates can have a variety of formats with file extensions .CER, .CRT, .DER, .PEM. Using openssl certificate can be converted from one format to another.

Below openssl commands converts Certificate (.CRT and .CER) and Distinguished encoding rules (.DER) formats to Privacy-enchanced electonic mail (.PEM) format.

Convert CER to PEM:

openssl x509 -outform pem -in cert.cer -out cert.pem

Convert CRT to PEM:

openssl x509 -outform pem -in cert.crt -out cert.pem

Convert DER to PEM:

openssl x509 -outform pem -in cert.der -out cert.pem