Public Key Infrastructure in Plain English

Public Key Infrastructure in Plain English

7 min read7 views

Super AdminSuper Admin

Public key infrastructure sounds intimidating, yet every time you open a website over HTTPS your browser runs through it in a fraction of a second. PKI answers one deceptively simple question: how can I be confident that this public key really belongs to the party it claims to belong to?

This article explains the moving parts in plain English, walks through certificate validation step by step and gives you a few commands to inspect certificates yourself.

The problem PKI solves

Asymmetric cryptography gives each party a key pair. The public key can be shared with anyone; the private key never leaves its owner. Anything encrypted with the public key can only be decrypted with the private key, and anything signed with the private key can be verified with the public key.

That is powerful, but it leaves a gap. If an attacker sits between you and your bank and hands you their public key while claiming it is the bank's, the mathematics works perfectly and you encrypt your secrets straight to the attacker. Cryptography alone cannot tell you who owns a key. You need a trusted third party to vouch for the binding between a key and an identity, and a way to check that vouching. That system of people, policies, software and hardware is PKI.

The components and who does what

Exam questions often test whether you can tell these roles apart, especially the certificate authority versus the registration authority, and CRL versus OCSP.

Core PKI components
ComponentRoleExam-relevant detail
Certificate Authority (CA)Issues and signs certificates, binding a public key to an identity.Root CAs are usually kept offline; intermediates do the day-to-day signing.
Registration Authority (RA)Verifies the identity of the requester before the CA issues.The RA checks identity but does not sign certificates.
Digital certificate (X.509)A signed document containing a public key, subject, issuer, validity dates and extensions.The format is defined by ITU-T X.509 and profiled for the internet in RFC 5280.
Certificate Revocation List (CRL)A signed list of serial numbers the CA has revoked before expiry.Periodically published, so it can be out of date and grow large.
OCSP responderAnswers real-time "is this certificate still good?" queries.Returns good, revoked or unknown for a single certificate.
Trust storeThe set of root certificates a system or browser trusts by default.Trust ultimately rests on what is pre-installed here.
Certificate Practice Statement (CPS)Describes how a CA operates and validates requests.Paired with the certificate policy that states the rules.
Hardware Security Module (HSM)Tamper-resistant hardware that generates and stores private keys.CAs protect their signing keys in HSMs.

The chain of trust

Your browser does not trust millions of website certificates individually. It trusts a relatively small set of root CAs whose certificates ship with the operating system or browser. Those roots sign intermediate CA certificates, and the intermediates sign the certificates that servers present.

When a server presents its certificate, it should also send the intermediates. The browser then builds a path: server certificate, signed by intermediate, signed by a root already in the trust store. If every link verifies, trust flows down the chain. If any link is missing or broken, the chain fails and you see a warning.

Why the extra layer? Keeping the root offline means its private key is rarely exposed. If an intermediate is compromised, it can be revoked and replaced without having to change the root that every device already trusts.

A combination padlock resting on a laptop keyboard
Photo: Unsplash

How a TLS certificate is validated, step by step

Implementations differ in detail, but a client validating a server certificate during a TLS handshake performs checks along these lines:

  1. Receive the certificate chain. The server sends its own certificate plus any intermediates.
  2. Build a path to a trusted root. The client links each certificate to its issuer until it reaches a root in its trust store.
  3. Verify each signature. Using the issuer's public key, the client checks that every certificate in the path was really signed by its issuer and has not been altered.
  4. Check validity dates. The current time must fall between each certificate's "not before" and "not after" dates.
  5. Check the name. The hostname being visited must match an entry in the certificate's Subject Alternative Name extension. Modern browsers rely on the SAN, not the Common Name.
  6. Check constraints and usage. CA certificates must be marked as CAs (basic constraints), and the server certificate must be permitted for server authentication (extended key usage).
  7. Check revocation status. Where the client performs it, this happens through OCSP, a stapled OCSP response or a CRL; browsers vary in how strictly they enforce it.
  8. Prove possession of the private key. During the handshake the server uses its private key, which an impostor holding only the certificate cannot do.

That last step is easy to overlook. A certificate is public; anyone can copy it. What proves you are talking to the genuine server is that it can perform an operation only the matching private key allows.

Revocation: CRL, OCSP and stapling

Certificates are revoked when a private key is compromised, the organization's details change or the certificate was issued in error. The two classic mechanisms trade off differently.

Certificate Revocation Lists

A CRL is a signed list the CA publishes on a schedule. Clients download it and check whether a serial number appears. The weaknesses are latency, since a revocation is only visible after the next publication, and size, because a busy CA's list can be large.

Online Certificate Status Protocol

OCSP lets a client ask about a single certificate in real time. It is lighter than downloading a CRL, but it introduces a privacy concern, because the CA learns which sites you visit, and a dependency on the responder being available. OCSP stapling addresses both: the server fetches a signed, time-stamped OCSP response itself and "staples" it to the handshake, so the client does not need to contact the CA.

Inspecting certificates yourself

Reading real certificates is one of the fastest ways to make PKI concrete. These OpenSSL commands work on most Linux and macOS systems. Replace the hostname and file names with your own.

# Show the chain a server presents (the input redirect closes the session)
openssl s_client -connect example.com:443 -servername example.com -showcerts < /dev/null

# Decode a saved certificate into readable text
openssl x509 -in server.pem -noout -text

# Print only the subject, issuer and validity dates
openssl x509 -in server.pem -noout -subject -issuer -dates

# List the Subject Alternative Names (OpenSSL 1.1.1 or later)
openssl x509 -in server.pem -noout -ext subjectAltName

# Verify a certificate against a root and an intermediate
openssl verify -CAfile root.pem -untrusted intermediate.pem server.pem

Try it against a few well-known sites and compare issuers, key types and validity periods. You will quickly notice how short public TLS certificate lifetimes have become, which is one reason automated renewal matters.

A short PKI glossary

Certificate Signing Request (CSR)
A message containing your public key and identity details, signed with your private key, that you send to a CA to request a certificate.
Subject Alternative Name (SAN)
The certificate extension listing the hostnames or addresses the certificate is valid for.
Self-signed certificate
A certificate signed by its own key. Every root is self-signed; a self-signed server certificate is only trusted if you install it explicitly.
Wildcard certificate
A certificate for a name such as *.example.com, valid for one level of subdomain. Convenient, but one compromised key affects every covered host.
Certificate pinning
An application accepting only a specific certificate or key for a service, which narrows trust but complicates rotation.
Key escrow
Storing a copy of a key with a trusted party so encrypted data can be recovered. Applied to encryption keys, never to signing keys used for non-repudiation.

Conclusion

PKI is a trust-distribution system. Cryptography makes the signatures unforgeable; the CA hierarchy, policies and revocation services decide whose signatures count. For exam purposes, be able to separate the CA from the RA, explain the chain of trust, list the validation checks in order and compare CRL with OCSP. For the original technical profile, see RFC 5280.

0.0 (0 ratings)
Share:

38 international certifications

Which certification are you preparing for?

Question banks, flashcards and mock exams built on each exam's official outline.

Browse certifications

Discussion (0)

No discussion here yet — be the first to comment.

Please sign in to join the discussion.

See all posts