Encrypt Online
Theme

Certificates & Site Ops

Certificate File Types Explained

Learn how CRT, CER, PEM, DER, KEY, P7B, and P12 files differ by encoding and container, then choose the correct format for certificate deployment tasks.

Encrypt Online Editorial Team2 min read
Encrypt Online guide cover on a sand background with the headline "Certificate file types". X.509 sits across a broad folded certificate page, with reserved space beneath the fold.

In brief

What it is: Certificate file types describe how certificates, keys, and bundles are encoded and packaged, not whether they are all interchangeable.

Why it matters: Teams lose time when they confuse PEM, DER, CRT, CER, KEY, and bundle files during deployment or conversion.

Worth knowing: Inspect the PEM label, ASN.1 structure, or container contents alongside the file extension.

Certificate workflows are confusing because several different things get mixed together: certificate contents, private keys, chains, container formats, and file extensions that vary by platform. The result is that people see a file named .crt, .cer, .pem, or .der and assume the extension alone tells the whole story.

Check what the file contains, how it is encoded, and what the target server or library expects.

The distinctions that matter

  • A file extension is only a hint. The actual contents and encoding determine how the file should be used.
  • PEM is a textual encoding commonly used for certificates and keys, while DER is binary.
  • Private keys, certificates, and chains each have different roles even if they share similar-looking filenames.
TermWhat it usually means
PEMBase64 text with header and footer lines
DERBinary encoding often used in stricter interchange contexts
CRT / CERCertificate file extension that may wrap PEM or DER depending on environment
KEYPrivate key file, often PEM-encoded in practice

Checks people skip

  • Sending a private key because the filename looked similar to the certificate file.
  • Assuming .crt always means PEM or .cer always means DER.
  • Converting file encodings without tracking whether you changed the certificate, key, or chain.

What still needs an answer

Is PEM more secure than DER?

They are different encodings, not security levels.

Can the same certificate exist as both PEM and DER?

Yes. The same certificate material can be represented in different encodings.

Do this locally (CLI)

Shell
openssl x509 -in cert.pem -text -noout
openssl pkey -in private-key.pem -text -noout
  • Inspect the contents before you trust the file extension.
  • Run private-key commands only inside an approved private environment.

References