X.509 certificate
An X.509 certificate is a digitally signed document that binds a public key to an identity, such as a website's domain name. It is the foundation of HTTPS and most other public-key infrastructure, and the Internet profile is defined in RFC 5280.
What is inside
Every X.509 certificate contains:
- A version (almost always v3) and a serial number unique to its issuer.
- The issuer: the certificate authority (CA) that signed it.
- The subject: who the certificate identifies.
- A validity period: a not-before and a not-after date.
- The subject’s public key, with its algorithm and size or curve.
- Extensions, such as the Subject Alternative Name, Key Usage, Extended Key Usage and Basic Constraints.
- The issuer’s signature over all of the above.
Certificates are usually stored as PEM text or binary DER.
Chains of trust
A certificate alone proves nothing. Trust comes from the chain: a server’s leaf certificate is signed by an intermediate CA, whose certificate is signed by a root CA. Roots are self-signed, and your operating system or browser ships a list of roots it trusts. To validate a connection, the client walks up from the leaf and checks each signature and validity period until it reaches a root it already trusts.
How long they last
Publicly trusted TLS certificates have a maximum lifetime set by the CA/Browser Forum, and it keeps shrinking. It was 398 days for years, and the Forum has approved a schedule that reduces it further over the coming years. Check the current Baseline Requirements before planning around a number. Shorter lifetimes are why automated renewal is now the norm.
Reading one
openssl x509 -in cert.pem -noout -text
Or paste it into the decoder linked below, which shows the same fields without sending the certificate anywhere.
Common pitfalls
- Hostname mismatch. Clients match the name you requested against the certificate’s Subject Alternative Names, not its common name.
- An incomplete chain. Servers must send the intermediates too. If they do not, some clients fail while others work by fetching the missing one.
- Expiry. The classic outage. A certificate is only valid inside its validity window, checked against the client’s clock.
- Self-signed certificates in production. Fine for development, but no public client trusts them by default.
- Confusing “valid” with “trusted”. A certificate can be inside its validity window and still be untrusted, revoked or issued to a different host.
Related terms
- PEM (Privacy-Enhanced Mail) — PEM is a text format that wraps Base64-encoded binary data, most often certificates and keys, between "BEGIN" and "END" marker lines so it can be copied, emailed and stored as plain text. RFC 7468 describes how it is used today.
- SAN (Subject Alternative Name) — The Subject Alternative Name is an X.509 certificate extension that lists every identity the certificate is valid for, such as DNS names, IP addresses, email addresses and URIs. Modern clients check the hostname against it and ignore the common name.
- SHA-256 (Secure Hash Algorithm, 256-bit) — SHA-256 is a cryptographic hash function from the SHA-2 family that turns any input into a fixed 256-bit digest, usually written as 64 hexadecimal characters. The same input always gives the same output, and it is infeasible to work backwards from the digest.
References
Ads on this page
Non-personalized ads help keep Vaultools free — Google decides where they appear on the page.
Go Pro to remove them →