Network Security

a digital certificate

A public key is just a number, and anyone can generate one and claim it belongs to your bank. So how do you trust that a public key really belongs to who it says? Think of a passport: it binds your photo and name together, and you trust it because a government you respect issued and stamped it. A digital certificate is the passport for a public key — a document that binds a public key to an identity (like a domain name), vouched for by the signature of a trusted third party.

Concretely, a certificate is a small data file containing a subject (e.g. the domain example.com), that subject's public key, a validity period, the issuer's name, and — crucially — a digital signature from a certificate authority (CA) over all of it. When your browser connects to a site over HTTPS, the server sends its certificate. Your browser checks the CA's signature using the CA's public key (which it already trusts, because it ships with a built-in list of trusted CAs), confirms the certificate hasn't expired or been revoked, and checks that the domain in the certificate matches the site you asked for. If all pass, the browser trusts that the public key in the certificate really belongs to that domain.

Why it matters: the certificate is what defeats a man-in-the-middle. Without it, an attacker could hand you their own public key while claiming to be your bank, and you'd happily encrypt your secrets straight to the attacker. The certificate cryptographically ties the key to the name. The crucial honest limit: a valid certificate proves only that you're talking to whoever controls that domain name — it says nothing about whether they're honest or their content is safe. A phishing site can get a perfectly valid certificate for its own lookalike domain. The lock icon means 'encrypted to this named server,' not 'this site is trustworthy.'

You visit https://example.com. The server presents a certificate saying 'public key K belongs to example.com,' signed by a CA. Your browser verifies the CA's signature, checks the name matches, and proceeds — confident the key really is example.com's. An attacker can't fake this without the CA's private key.

A passport for a public key, stamped by a trusted CA.

A valid certificate proves identity, not honesty. It confirms you're talking to the named domain — but a scam site can hold a perfectly valid certificate for its own scam domain. The padlock is not a seal of approval.

Also called
public-key certificateX.509 certificateSSL certificateTLS certificate數位憑證公鑰憑證