Files of type CER are a security file that is used to store an X.509 certificate. It is provided by an accredited certification authority. It contains information about the owner of the certificate and the public key.
PEM files are bas64 encoded ASCII files in which certification authorities issue certificates. This format is used to store and send cryptographic keys, certificates, and other intermediate certificates.
In order to convert a CER file to PEM, you need the following:
The OpenSSL toolkit is only installed by default on Ubuntu. However, if it is not there, you can install it with the following command in Terminal:
apt install openssl
Enter your sudo password. When prompted to choose the y / n option, press y to continue. This will start the installation of OpenSSL on the system. To convert a CER file to PEM use the following syntax:
openssl x509 -inform der -in cert.cer -outform pem -out cert.pem
In the above syntax, cert.cer is the name of the security certificate you want to convert to PEM format, and cert.pem is the filename after the final conversion.
To convert a PEM file to CER use the following syntax:
openssl x509 -inform PEM -in cert.pem -outform DER -out cert.cer