pki: how certificates work

Public key crypto has one weak spot: how do you know a public key really belongs to who it claims? Public key infrastructure (PKI) answers that with certificates and a chain of signatures that leads back to someone you already trust.

a certificate

A certificate is a public key with a name attached, signed by a certificate authority (CA). The signature is the CA vouching that this key belongs to this name.

+----------------------------------------------+
| subject      CN = example.com                |
| alt names    example.com, www.example.com    |
| public key   ec p-256   04:8b:1f:3e:...      |
| valid        2026-11-01  to  2027-01-30      |
| issuer       CN = Example Issuing CA         |
+----------------------------------------------+
| signature    made with the issuer's key      |
+----------------------------------------------+

The format is X.509. Change any byte of the certificate and the signature no longer verifies.

the chain of trust

+-------------------+
|      root ca      |   self-signed, ships with your
+-------------------+   os and browser
          |
          | signs
          v
+-------------------+
|  intermediate ca  |   does the day-to-day issuing
+-------------------+
          |
          | signs
          v
+-------------------+
|    example.com    |   the leaf, sent by the server
+-------------------+

Root keys are kept offline, usually in a hardware security module (HSM). If an intermediate is compromised it can be revoked without replacing the root on every device in the world.

what your browser checks

  1. every signature in the chain is valid, up to a root in the trust store
  2. every certificate is inside its validity dates
  3. the domain matches one of the certificate's alt names
  4. key usage and constraints allow this certificate to be used this way
  5. nothing in the chain has been revoked

If any step fails, you get the full-page warning.

revocation and short lives

Revocation has always been the weak part. Revocation lists grow large, and online status checks (OCSP) leak which sites you visit and are often skipped when they fail. The industry's answer is short-lived certificates. The maximum lifetime of a public TLS certificate is shrinking in steps to 47 days by 2029, which makes automation with ACME, the protocol Let's Encrypt uses, effectively mandatory.

look for yourself

# fetch a site's certificate chain
openssl s_client -connect example.com:443 -showcerts </dev/null

# read a certificate
openssl x509 -in cert.pem -noout -text

# verify a chain
openssl verify -CAfile root.pem -untrusted inter.pem cert.pem

PKI is not just the web. The same model signs software, secures email (S/MIME), authenticates devices and VPN clients, and sits behind smart cards.