A first thing to understand is that a CER certificate can be encoded either in PEM or in DER.
DER is a binary format while PEM is a base64 encoding.
The .cer extension simply means "certificate", we quite often find either .cer or .cert.
Convert to CRT with OpenSSL
To convert a .cer certificate to .crt with OpenSSL you need to use the following command:
openssl x509 -inform DER -in monCertif.cer -out monCertif.crt
If you encounter an error, your certificate may be PEM encoded. Two solutions are therefore available to you, either regenerate a .cer certificate encoded in DER, or use the following command:
openssl x509 -inform PEM -in monCertif.cer -out monCertif.crt
Hint:
To directly use the "openssl" , you just need to add the "bin" of your OpenSSL installation in the PATH environment variable of your machine.
Go to => Control Panel\System and Security\System
Click "Advanced system settings"
then "Environment Variables..."
And add the folder path "bin" of your OpenSSL installation
There you go, that’s it, enjoy!
Comments