Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert .crt to .pem [duplicate]

Tags:

pem

asn.1

der

x509

crt

People also ask

Can I just rename CRT to PEM?

Just change the file extension from . crt to . pem in the Windows File Explorer. In order to convert SSL certificate files, you need to use third-party tools.

Is PEM and CRT the same?

pem adds a file with chained intermediate and root certificates (such as a . ca-bundle file downloaded from SSL.com), and -inkey PRIVATEKEY. key adds the private key for CERTIFICATE. crt (the end-entity certificate).


You can do this conversion with the OpenSSL library. Windows binaries can be found here.

Once you have the library installed, the command you need to issue is:

openssl x509 -in mycert.crt -out mycert.pem -outform PEM

I found the OpenSSL answer given above didn't work for me, but the following did, working with a CRT file sourced from windows.

openssl x509 -inform DER -in yourdownloaded.crt -out outcert.pem -text