Certificate guides

Compare certificate fingerprints across PEM and DER files

·

A PEM file wraps binary certificate bytes in printable text. Compare digests at the certificate-byte level to avoid changes caused only by line wrapping.

Certificate Fingerprint Generator

Compare files with different encodings

Read a DER file and a PEM copy of the same certificate. Compare the SHA-256 values byte for byte. SHA-256 has 32 bytes, SHA-384 has 48 and SHA-512 has 64. Colons separate bytes for readability.

IETF RFC 7468 — Textual Encodings of PKIX StructuresNIST FIPS 180-4 — Secure Hash Standard

Trace a renewed certificate

When a renewal changes the validity period or serial number, its full DER bytes change. Compare against a trusted reference for that exact issued certificate and algorithm. A public key can survive a renewal with a different full-certificate fingerprint.

IETF RFC 5280 — Internet X.509 Public Key Infrastructure Certificate ProfileNIST FIPS 180-4 — Secure Hash Standard

Compare the intended certificate in a bundle

A server certificate and its issuer can appear in the same PEM file. Select the intended entry and check its subject and serial before comparing fingerprints. Two correct SHA-256 calculations on different entries will produce different digests.

For an identity check, obtain the expected fingerprint through a trusted independent channel. A digest included beside the same untrusted file only confirms that the two supplied values agree.

Common questions

Does the case of hexadecimal letters matter?

Uppercase and lowercase are equivalent when they encode the same bytes. Normalize letter case and separators before comparing.

Can I compare these values to an SPKI pin?

An SPKI pin hashes the public-key information. These results hash the full certificate, so the inputs differ.

Sources

Put it into practice.

Related guides