Search code examples
sslcertificate

What is the difference between .CER and .CRT?


Is there a difference between .cer and .crt. I know they both are same SSL certificate format, but don't know what is the difference between them.

If there no difference, why 2 different extensions?


Solution

  • None.

    Extensions are useless, as are filenames. They DO NOT count. Only the content counts. The software does not care how you call your filenames, holding certificates and private keys, it could be foobar.42 and would work as well (as long as the content is correct).

    The names are only to aid the humans to more easily know what it is about. It is customary for example to use the site name as filename to clearly identify it, and then use "some" extension, on one side for a certificate (.cert or .crt or .cer) and a private key (.key). You also have certificate signing requests (something you generate before getting the certificate), which are often .csr.

    You may find .pem sometimes also, which is ambiguous: PEM is a format to encode a content, you can encode a certificate or a key, so just by .pem you do not know what it is about where .crt vs .key at least make the difference clear.

    Now, .cert would probably be the most obvious choice... but since we inherit from some past arbitrary limits of some past OS, we often prefer 3 letters for extensions, at most, so pick your poison between shortening .cert either to .cer or .crt (the latter seems to me more often found). Also for the same silly past arbitrary decisions, some OS attaches specific actions on specific files based on their name. Your OS may treat the same file differently if it ends in .crt vs ending in .cer. But this is all configuration and local preferences, again only the content really matters.