OpenSSL is an open-source full-featured command-line utility that is usually used for generating CSR and private keys, installing SSL/TLS certificates, converting security certificate formats, etc.
In today’s post, we will describe how to convert a CER file to PEM.
Note: The commands shown here have been demonstrated on Ubuntu 20.04 LTS Terminal. To open the Terminal in Ubuntu desktop, hit the super key and launch it from the Applications menu or use the Ctrl+Alt+T shortcut to open it.
CER File
A CER file is a security file used to store X.509 certificate. It is provided and issued by CA (certificate authority) that verifies the authenticity of a website. It contains information about the certificate owner and public key.
PEM File
PEM (Privacy Enhanced Mail) is the bas64 encoded ASCII files that certificates’ authorities issue certificates in. This format is used for storing and sending cryptographic keys and certificates and other intermediate certificates.
Converting a CER File to PEM
OpenSSL toolkit is by default installed in Ubuntu. However, if it is not there, you can install it through the following command in Terminal:
Enter sudo password. When you are prompted with the y/n option, hit y to carry on. After that, it will begin installing OpenSSL on the system.
To convert a CER file to PEM, use the following syntax:
In the above syntax, cert.cer is the name of the security certificate you want to convert in PEM format and cert.pem is the name of the file after conversion.
Converting PEM to CER
To convert a PEM file to CER, use the following syntax:
In the above syntax, cert.pem is the name of the security certificate you want to convert in CER format, and cert.cer is the name of the certificate after conversion.
This is how you can convert a CER file to PEM using the OpenSSL utility. Hope it helps!