How do you trust that a public key really belongs to who it claims? Enter PKI — Public Key Infrastructure.
A digital signature provides authentication, integrity, and non-repudiation.
Sign: signature = encrypt(hash(message), PRIVATE key)
Verify: hash(message) == decrypt(signature, PUBLIC key)
A digital certificate (X.509) binds a public key to an identity (e.g., a domain name) and is signed by a trusted Certificate Authority (CA).
A certificate contains:
example.com)Root CA (self-signed, in your OS/browser trust store)
│ signs
Intermediate CA
│ signs
Server certificate (example.com)
Your browser trusts the root CA out of the box. Because trust flows down the chain, it can verify example.com without ever having seen it before. If any link fails verification, you get a certificate warning.
| Stage | What happens |
|---|---|
| CSR | You generate a key pair and a Certificate Signing Request |
| Validation | CA verifies you control the domain |
| Issuance | CA signs and issues the cert |
| Renewal | Certs expire (often 90 days); automate renewal |
| Revocation | Compromised certs revoked via CRL / OCSP |
Let's Encrypt + tools like certbot make TLS certificates free and automatable. There's no excuse for plain HTTP today.
In high-security and zero-trust environments, both client and server present certificates — strong, mutual authentication used heavily between microservices.