Certificates and PKI
The conceptHow does your browser know a public key really belongs to your bank?
A public key is just a number, so anyone could claim theirs is the bank's. A certificate is a file saying "key K belongs to mybank.com until March", signed by a certificate authority (CA), a company that checks who owns which name.
Your browser checks that signature with the CA's public key, like any digital signature. PKI (public key infrastructure) is the whole setup: the CAs, their rules, and the list of CAs your device trusts from the start.
What it’s forDecides whether a certificate is real: the CA's signature must check out over the certificate's contents.
Verify(K_CA, σ, H(n ‖ K)) = true
- K_CA
- the public key of the CA that issued the certificate
- σ
- the CA's signature printed in the certificate
- H
- a hash function such as SHA-256, a fingerprint of the contents
- n ‖ K
- the site's name joined to its public key (plus validity dates and other details)
What it givesYes if the CA really signed exactly this name and key; no if anything was changed or someone else signed it.
- mybank.com sends a certificate signed by intermediate CA X → check 1
- X's own certificate is signed by root CA R → check 2
- R is already in your browser's trusted list → stop: 2 checks, chain valid