Public key infrastructure: trusting a certificate

8 min 6 sections 4 practice questions 11 sources citedISC2 objective 3.6

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.

The main fields of an X.509 version 3 certificate
FieldWhat it holds
VersionThe format version, normally 3
Serial numberA number unique among the issuer's certificates, used when revoking it
Signature algorithmThe the CA used to sign, for example ECDSA with SHA-256
IssuerThe name of the CA that signed it
ValidityNot before and not after dates
SubjectThe name of the holder
Subject public key informationThe holder's public key and its algorithm
ExtensionsFurther details: other names covered, permitted key uses, whether the subject may act as a CA
CA's signatureThe 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

A website is trusted through a chain of signatures to a rootA root CA certificate inside the browser's trust store signs an intermediate CA certificate, which signs the website's certificate. From the website certificate the browser makes five numbered checks.Trust storeRoot CAself-signedIntermediate CAsigned by rootWebsite certificatesigned by intermediateBrowser's checks1 each signature verifies2 every date is valid3 nothing is revoked4 each issuer may be a CA5 the site's name matchessignssignsA website is trusted through a chain of signatures to a rootA root CA certificate inside the browser's trust store signs an intermediate CA certificate, which signs the website's certificate. From the website certificate the browser makes five numbered checks.Trust storeRoot CAself-signedIntermediate CAsigned by rootWebsite certificatesigned by intermediateBrowser's checks1 each signature verifies2 every date is valid3 nothing is revoked4 each issuer may be a CA5 the site's name matchessignssigns
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.

  1. 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.
  2. 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.
  3. The website certificate is an end-entity certificate holding the site's name and public key, signed by the intermediate.
  4. 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.
  5. 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.
  6. 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.
  1. Build the chain: website certificate, then the intermediate named as its issuer, then a root found in the trust store.
  2. Check each signature with the public key in the certificate above it.
  3. Check that the current date is inside each certificate's validity period.
  4. Check that no certificate in the chain has been revoked.
  5. Check that each issuer is permitted to act as a CA.
  6. 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

  1. Key generation: the applicant creates a key pair. The private key never leaves the applicant.
  2. Enrolment: the applicant sends a certificate signing request (CSR), holding the public key and the name, signed with the private key to prove possession.
  3. : the CA or checks that the applicant controls the name, to the depth the certificate type demands.
  4. Issuance: the CA signs the certificate and returns it.
  5. Use and validation: relying parties check it every time it is presented.
  6. Renewal: before the not-after date, a new certificate is issued, ideally for a new key.
  7. Suspension or revocation: a certificate is placed on hold temporarily, or revoked permanently when the key is compromised or the details are wrong.
  8. 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.

Three ways to learn whether a certificate has been revoked
MethodHow it worksStrengthWeakness
Certificate revocation list (CRL)The CA publishes a signed list of revoked serial numbers on a schedule, such as dailyWorks offline once downloadedNews 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 unknownCurrent, and smallAn extra query each time; the responder learns which sites are visited
OCSP staplingThe website fetches its own signed, time-limited OCSP answer and sends it during the connectionCurrent, fast and privateDepends 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.

Trust models compared
ModelHow trust flows
HierarchicalOne root at the top; every certificate chains to it
Cross-certification and bridgeSeparate PKIs sign each other's CAs, directly or through one central bridge CA
Web of trustNo 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.

  1. 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.
  2. 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.
  3. Today's date lies inside both validity periods.
  4. The site sends a stapled OCSP answer, signed by the CA, saying "good" and issued an hour ago.
  5. 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?

  1. Turn on OCSP stapling so the portal sends its signed status in each connection
  2. Publish the certificate revocation list every hour instead of once each day
  3. Pin the portal's public key inside the browsers used by staff at every branch
  4. Issue the portal's certificates with a validity period of thirty days at most
Decide on your answer, then open the reasoning
  1. Two requirements: current revocation status, and no large download on a slow link.
  2. Rule out c. Pinning stops a false certificate from another CA. It says nothing about whether the portal's own certificate has been revoked.
  3. 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.
  4. Between a and b: an hourly list is fresher, and every browser still downloads the whole list, so the delay remains.
  5. 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

A bank's auditors ask for the document that sets out how the bank's own internal certificate authority checks applicants, protects its keys and revokes certificates. Which document should they be given?

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

  1. 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.

    Read this part again

  2. 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.

    Read this part again

  3. 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.

    Read this part again

  4. 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.

    Read this part again

  5. 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.

    Read this part again

  6. 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.

    Read this part again

Sources