[x509] How to convert .crt to .pem

How can I convert .crt to .pem?

This question is related to x509 pem asn.1 crt der

The answer is


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