Public key infrastructure: trusting a certificate
A public key is only useful if the person relying on it knows whose key it is. Public key infrastructure is the system of authorities, certificates, rules and status checks that answers it for millions of strangers at once. Passport offices do the same for border staff facing a traveller they have never met. No background beyond digital signatures is assumed. Every protected website, signed program and smart card sign-in rests on it.
By the end of this unit you will be able to:
- Explain what public key infrastructure is and what a certificate authority and a registration authority each do
- Put in order the checks a browser makes on a certificate chain from a website to a trusted root
- Put in order the stages in the life of a certificate, from request to expiry or revocation
- Tell apart CRL, OCSP and OCSP stapling, and choose between them for a given need
- Explain what pinning, Certificate Transparency and the main trust models add
A stolen key with eleven months to run
An illustrative example
An online bookshop discovers that an intruder has copied the private key from its web server. The certificate for that key is valid for another eleven months.
Anyone holding the key can now set up a copy of the shop's site that browsers will accept as genuine. The shop makes a new key and a new certificate the same day. The old certificate, though, still carries a valid signature from a trusted authority.
How can a browser learn that a certificate with a valid signature and many months to run must no longer be trusted?
Who vouches for a public key
removes the need to deliver , and it leaves one problem: proving whose public key is whose. Public key infrastructure (PKI) is the set of roles, , systems and that create, distribute, check and withdraw . Its job is key distribution: getting the right public key to everyone who needs it, in a form they can trust.
- Certificate authority (CA)
- The trusted body that checks an applicant and signs certificates. Its signature is what trust.
- Registration authority (RA)
- An optional body to which a hands identity checking and similar work. It verifies applicants and passes approved requests on; it does not sign certificates.
- Subject or end entity
- The person, server or device named in a certificate.
- Relying party
- Anyone who uses a certificate to decide whether to trust a key, such as a browser.
Quantum key distribution is a different answer to a related job. It uses the physics of light over special links to share a . It cannot prove who is at the other end, so it still needs other for authentication, and the United Kingdom's National Cyber Security Centre does not support it for government use.
What a certificate contains, and the kinds of certificate
Almost every certificate follows the X.509 format, version 3.
| Field | What it holds |
|---|---|
| Version | The format version, normally 3 |
| Serial number | A number unique among the issuer's certificates, used when revoking it |
| Signature algorithm | The the CA used to sign, for example ECDSA with SHA-256 |
| Issuer | The name of the CA that signed it |
| Validity | Not before and not after dates |
| Subject | The name of the holder |
| Subject public key information | The holder's public key and its algorithm |
| Extensions | Further details: other names covered, permitted key uses, whether the subject may act as a CA |
| CA's signature | The issuer's over all of the above |
- Self-signed: issued and signed by the same body. Trusted only if obtained by a trusted route. Every root certificate is self-signed.
- Subject alternative name: one certificate listing several names, such as a shop's main site and its payments site.
- Wildcard: one certificate for every name at one level of a domain, such as any name ending in .bookshop.example. One stolen key then exposes all of them.
- Domain validated, organisation validated and extended validation: the CA checked control of the domain only, the organisation as well, or the organisation's legal, physical and operational existence in depth.
- Code signing and client certificates: for software publishers, and for users or devices proving who they are.
The chain from root to website
A browser does not know every CA. It holds a trust store: a short list of root certificates supplied with the operating system or browser.
A root CA is at the top. Its key is so valuable that it signs only the certificates of intermediate CAs, and it can be kept offline. Intermediate CAs sign the end-entity certificates that websites and people use. If an intermediate is compromised, it can be revoked without replacing the root in every trust store.
A website is trusted through a chain of signatures to a root
Read this figure as text
A browser does not know every certificate authority. It holds a trust store, a short list of root certificates supplied with the operating system or browser, and builds a chain from the website's certificate up to one of them.
- The root CA certificate is self-signed and sits in the trust store. Its key is so valuable that it signs only intermediate CA certificates, and it can be kept offline.
- The intermediate CA certificate is signed by the root. It signs the end-entity certificates that websites use, and if it is compromised it can be revoked without replacing the root in every trust store.
- The website certificate is an end-entity certificate holding the site's name and public key, signed by the intermediate.
- The browser builds the chain from the website certificate to the intermediate named as its issuer, then to a root found in the trust store, and makes five checks.
- 1: each signature verifies with the public key in the certificate above it. 2: the current date is inside every certificate's validity period. 3: no certificate in the chain has been revoked, learnt from a CRL, OCSP or a stapled OCSP answer.
- 4: each issuer is permitted to act as a CA. 5: the website's name appears in the end-entity certificate. Failure at any step ends trust in the whole chain.
- Build the chain: website certificate, then the intermediate named as its issuer, then a root found in the trust store.
- Check each signature with the public key in the certificate above it.
- Check that the current date is inside each certificate's validity period.
- Check that no certificate in the chain has been revoked.
- Check that each issuer is permitted to act as a CA.
- Check that the website's name appears in the end-entity certificate.
Failure at any step ends trust in the whole chain.
The life of a certificate
- Key generation: the applicant creates a key pair. The private key never leaves the applicant.
- Enrolment: the applicant sends a certificate signing request (CSR), holding the public key and the name, signed with the private key to prove possession.
- : the CA or checks that the applicant controls the name, to the depth the certificate type demands.
- Issuance: the CA signs the certificate and returns it.
- Use and validation: relying parties check it every time it is presented.
- Renewal: before the not-after date, a new certificate is issued, ideally for a new key.
- Suspension or revocation: a certificate is placed on hold temporarily, or revoked permanently when the key is compromised or the details are wrong.
- Expiry: after the not-after date the certificate is invalid, whatever its status.
Two documents govern a CA. The certificate policy (CP) states the rules a certificate must meet and what it may be used for. The certification practice statement (CPS) describes how one particular CA carries those rules out. The CP says what; the CPS says how.
Revocation: CRL, OCSP and stapling
Revocation tells relying parties to stop trusting a certificate before it expires. Three methods carry the news.
| Method | How it works | Strength | Weakness |
|---|---|---|---|
| Certificate revocation list (CRL) | The CA publishes a signed list of revoked serial numbers on a schedule, such as daily | Works offline once downloaded | News waits for the next list; lists grow large |
| Online Certificate Status Protocol (OCSP) | The relying party asks a responder about one certificate and gets a signed answer: good, revoked or unknown | Current, and small | An extra query each time; the responder learns which sites are visited |
| OCSP stapling | The website fetches its own signed, time-limited OCSP answer and sends it during the connection | Current, fast and private | Depends on the server attaching it |
OCSP's answer "revoked" covers both permanent revocation and a temporary hold, which is how suspension appears to a relying party.
Common misconception
“A certificate with a valid CA signature and future expiry date can be trusted.”
The signature and dates stay valid after revocation. Only a revocation check shows that the bookshop's old certificate must be refused.
Pinning, transparency and other trust models
Any CA in a trust store can sign a certificate for any name, so one careless or attacked CA can issue a false certificate for a bank. Two controls narrow that gap.
Pinning has an application accept only a key or certificate it already expects for a site, refusing others even when a trusted CA signed them. It is used today mainly inside mobile and other applications.
Certificate Transparency records certificates in public logs that can only be added to. Site owners watch the logs and notice a certificate issued for their name that they never requested.
| Model | How trust flows |
|---|---|
| Hierarchical | One root at the top; every certificate chains to it |
| Cross-certification and bridge | Separate PKIs sign each other's CAs, directly or through one central bridge CA |
| Web of trust | No authority: users sign each other's keys and choose whose introductions to accept, as in PGP email |
Direct cross-certification suits two or three PKIs, because every pair that must trust each other needs its own cross-certificates. As more PKIs join, those pairs multiply. A bridge CA is then used instead: each PKI cross-certifies once, with the bridge, so the number of links grows only in step with the number of PKIs.
Worked example: A browser checks the bookshop's new certificate
A browser connects to the bookshop's site and receives the site's certificate and one intermediate certificate. The browser's trust store holds 150 root certificates.
- The site certificate names "Example Issuing CA 2" as issuer. The browser finds that intermediate, which names "Example Root CA" as its issuer. That root is in the trust store.
- The browser checks the site certificate's signature with the intermediate's public key, and the intermediate's signature with the root's public key. Both verify.
- Today's date lies inside both validity periods.
- The site sends a stapled OCSP answer, signed by the CA, saying "good" and issued an hour ago.
- The intermediate's extensions permit it to act as a CA. The site certificate lists the address the user typed.
Every check passes, so the browser trusts the site's public key. Had the old, revoked certificate been presented, step 4 would have returned "revoked" and the connection would have stopped.
A question, worked through
A security manager at a building society hears that branch staff wait several seconds whenever the internal web portal opens. The delay is the browsers downloading a large certificate revocation list over slow branch links. Revocation checks cannot be switched off, because the board requires current certificate status.
Which change BEST keeps current revocation checking while removing the delay?
Decide on your answer, then open the reasoning
- Two requirements: current revocation status, and no large download on a slow link.
- Rule out c. Pinning stops a false certificate from another CA. It says nothing about whether the portal's own certificate has been revoked.
- Rule out d. Short validity limits how long a stolen key is useful, and the board still requires a revocation check within those thirty days.
- Between a and b: an hourly list is fresher, and every browser still downloads the whole list, so the delay remains.
- Option a sends one small, signed, recent answer inside the connection itself. It is current and adds no download.
Answer: A. Turn on OCSP stapling so the portal sends its signed status in each connection
Choosing between good answers
- A question asks which body verifies an applicant's identity but does not sign
- it is the registration authority. The certificate authority signs.
- A question needs revocation status that is current and fast without exposing user browsing to the CA
- choose OCSP stapling. Choose a CRL when relying parties must work offline.
- A scenario has a trusted CA wrongly issuing a certificate for a site
- Certificate Transparency detects it, and pinning stops applications from accepting it.
- A question asks why a root CA signs only intermediates
- so the root key can stay offline and a compromised intermediate can be revoked without replacing the root.
Try it
Follow a website's certificate up to its root and see which failed check ends the trust.
Loading the preview.
Check your understanding
4 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.
These questions are drafts that no named reviewer has approved yet.
Question 1 of 4
What to remember
- PKI is the system of CAs, RAs, certificates, policies and status services that binds names to public keys for relying parties.
- An X.509 certificate holds the subject's name and public key, the issuer, a serial number, validity dates and extensions, all signed by the CA.
- Browsers trust a chain from the website's certificate through intermediates to a root in their trust store, checking signatures, dates, revocation, CA permission and name.
- A CRL is a periodic list; OCSP answers for one certificate on request; stapling has the site deliver its own signed OCSP answer.
- Pinning restricts which keys an application accepts; Certificate Transparency makes every issued certificate publicly visible.
Say it from memory
What is public key infrastructure, and how does a relying party decide to trust a website's certificate?
PKI is the set of roles, policies and systems (CAs, RAs, certificates, revocation services) that distributes public keys bound to names. The relying party builds a chain from the site certificate through intermediates to a root in its trust store. It then checks each signature, the validity dates, revocation (CRL, OCSP or stapling), CA permission and the site's name. Quantum key distribution shares keys by physics and gives no authentication.
How does a certificate authority differ from a registration authority?
A certificate authority is the trusted body that checks an applicant and signs certificates; its signature is what relying parties trust. A registration authority is an optional body to which a CA hands identity checking. It verifies applicants and passes approved requests on, and it does not sign certificates.
What is the risk of a wildcard certificate, and how do domain, organisation and extended validation differ?
A wildcard covers every name at one level of a domain, so one stolen key exposes all of them. Domain validated means the CA checked control of the domain only. Organisation validated adds the organisation. Extended validation checks the organisation's legal, physical and operational existence in depth.
What is a certificate signing request, and how does a certificate policy differ from a certification practice statement?
A CSR holds the applicant's public key and name, signed with the private key to prove possession. The certificate policy states the rules a certificate must meet and what it may be used for. The certification practice statement describes how one particular CA carries those rules out. The CP says what; the CPS says how.
How do a CRL, OCSP and OCSP stapling each report revocation?
A certificate revocation list is a signed list of revoked serial numbers the CA publishes on a schedule; news waits for the next list. OCSP lets a relying party ask a responder about one certificate and get a signed answer: good, revoked or unknown. With OCSP stapling the website fetches its own signed, time-limited answer and sends it in the connection.
What do certificate pinning and Certificate Transparency each do, and how does a web of trust differ from a hierarchy?
Pinning has an application accept only a key or certificate it already expects for a site. Certificate Transparency records certificates in append-only public logs, so owners notice one they never requested. A hierarchy has one root that every certificate chains to. A web of trust has no authority: users sign each other's keys, as in PGP.
Sources
- RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, IETFX.509 certificate fields; CA, RA, end entity and CRL issuer roles; self-signed certificates beginning certification paths; the cA flag; CRLs issued periodically; and the path validation checks of signature, validity period, revocation and issuer name.
- RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP, IETFOCSP status answers good, revoked and unknown, signed responses, and revoked covering a temporary hold.
- RFC 6066: Transport Layer Security (TLS) Extensions: Extension Definitions, IETFThe certificate status request by which a server sends an OCSP response in the TLS handshake, saving round trips.
- RFC 9162: Certificate Transparency Version 2.0, IETFPublic append-only logs of TLS server certificates that let anyone audit CA activity and notice suspect certificates.
- RFC 7469: Public Key Pinning Extension for HTTP, IETFPinning a host's keys so that a chain without a pinned key is refused, limiting damage from a compromised CA.
- RFC 3647: Internet X.509 Public Key Infrastructure Certificate Policy and Certification Practices Framework, IETFThe certificate policy as the rules for a certificate's applicability and the certification practice statement as how one CA carries them out.
- RFC 4158: Internet X.509 Public Key Infrastructure: Certification Path Building, IETFHierarchical, mesh and bridge CA structures and cross-certificates between CAs. Section 1.5.4: a bridge CA cross-certifies once with one CA in each participating PKI, so cross-certified relationships grow linearly with the number of PKIs, while in a mesh they grow far faster.
- RFC 4880: OpenPGP Message Format, IETFOpenPGP users certifying each other's keys and naming trusted introducers.
- Baseline Requirements for the Issuance and Management of Publicly-Trusted TLS Server Certificates, CA/Browser ForumRoot CA private keys not used to sign subscriber certificates, and the domain-validated and organisation-validated certificate policies.
- Guidelines for the Issuance and Management of Extended Validation Certificates, CA/Browser ForumExtended validation checks of an organisation's legal, physical and operational existence in addition to domain control.
- Quantum networking technologies, UK National Cyber Security CentreQuantum key distribution provides no authentication and the NCSC does not support it for government or military use.