Get your FREE copy of "The Ultimate Guide of SSL"

Download Ebook

How to Convert a Certificate to PEM: CRT to PEM, CER to PEM, DER to PEM

SSL/TLS certificates are a kind of X.509 digital certificates that are issued in different formats like CER, PEM, etc. These certificates are generally used to authenticate the identity of a website and to create an encrypted connection between the web server and the browser. While working with these digital certificates, you will need to remember that not all servers and devices will accept the same format and certain servers might require a different format. For instance, you might have to convert CRT to PEM if the server accepts only PEM and not CRT.

The following are the different extension types to which you can convert your certificates.

  • .CER OR .CRT – Certificate
  • .DER – Distinguished encoding rules
  • .PEM – Privacy-enhanced electronic mail
Looking to convert a certificate to PEM? We are here to help you convert your certificate to PEM. This article will walk you through the process of converting CRT to PEM, CER to PEM, and DER to PEM in OpenSSL.

How to Convert Your Certificate to PEM Using OpenSSL

There are certain OpenSSL commands to transform CER to PEM, CRT to PEM, and DER to PEM.

1. CRT to PEM Using OpenSSL

You will have to type in this command into your OpenSSL client to convert CRT to PEM.
openssl x509 -in cert.crt -out cert.pem

2. CER to PEM Using OpenSSL

This command will help you transform CER to PEM. Type it in your OpenSSL client to convert your certificate.
openssl x509 -in cert.cer -out cert.pem

3. DER to PEM Using OpenSSL

To transform DER to PEM, type in the following command into your OpenSSL client.
openssl x509 -in cert.der -out cert.pem

Summary

You might want to convert a certificate to PEM for different reasons. It could be because your server is not accepting the current format or because it isn’t compatible with the software you are using. Whatever may be the reason you are looking to convert your certificate to PEM, you can do so easily by following the steps mentioned in this article, using OpenSSL. The mentioned OpenSSL commands will help you to change the file format quickly.
Disclosure: AboutSSL appreciates your continuous support. It helps us tremendously to keep moving in the competitive SSL industry. Here most of the links which direct you to buy any SSL/TLS related service or products earns us a certain percentage of referral commission. Learn More