PKI explained

What is PKI?

The short answer

PKI, short for public key infrastructure, is the system of keys, digital certificates, certificate authorities and rules that lets computers check who a public key belongs to. It is how your browser knows it is talking to the real website, and how signed software, email and devices prove who they are.

Who it is for
Level
Beginner
Reading time
About 16 minutes
On this page
  1. What is PKI, in plain words?
  2. Why does PKI exist?
  3. What is a PKI made of?
  4. How PKI works, from key pair to padlock
  5. Where is PKI used?
  6. Is there just one PKI?
  7. What PKI is not
  8. Where is PKI heading?
  9. Why does PKI matter to a business?
  10. Where to go next
  11. Frequently asked questions
  12. Keep going

What is PKI, in plain words?

Every time you open a website whose address starts with https://, your device quietly asks a question: am I really talking to this website, or to someone pretending to be it? PKI is the system that answers that question, billions of times a day, without you noticing.

PKI stands for public key infrastructure. The name has two halves.

  • Public key comes from public-key cryptography. Each person, server or device has a key pair: a private key that it keeps secret, and a public key that it can hand to anyone. Depending on the algorithm, anyone can use the public key to encrypt for the owner or to check the owner’s signatures, but only the private key can decrypt or sign. You can read how that works in Key pairs: public and private keys.
  • Infrastructure is everything built around those keys so that strangers can rely on them: the organisations that vouch for keys, the documents they issue, the lists your device trusts, and the rules that everyone follows.

The central document is a digital certificate. It is a small file that says “this public key belongs to this name”, signed by a certificate authority (CA) that checked the claim first. Your device already trusts a short list of CAs, kept in its trust store. If a certificate leads back to a CA on that list, your device accepts that the key really belongs to the name.

The Internet Security Glossary, RFC 4949, gives the formal definition used for internet PKI. A PKI is “the set of hardware, software, people, policies, and procedures needed to create, manage, store, distribute, and revoke digital certificates based on asymmetric cryptography.” Notice the people, policies and procedures. PKI is not one product you install. It is technology plus the rules and the organisations that keep it honest.

Why does PKI exist?

Public-key cryptography solved an old problem and created a new one.

The old problem is sharing secrets. With symmetric encryption, both sides need the same secret key, and that key has to travel to the other side without anyone seeing it. Every pair of people needs its own key. That works for two spies, but not for billions of people and websites who have never met. The key-distribution problem explains why.

Key pairs fix this. You can publish your public key openly. Anyone can use it to agree a secret with you or to check your digital signatures, and only you hold the private key.

The new problem is this: anyone can publish a public key and put any name on it. Imagine an attacker places their own public key on the network and labels it “your bank”. You encrypt your password to that key. The maths works perfectly, and the attacker reads everything. This is a man-in-the-middle attack. Nothing was cracked. You simply used the wrong key.

So the real question is: whose key is this? There are a few ways to answer it, and the handbook chapter Whose key is it? compares them:

  • compare the key’s fingerprint with its owner over another channel, such as a phone call;
  • trust the key the first time you see it and raise an alarm if it ever changes, as SSH does;
  • let friends vouch for friends’ keys, a “web of trust”;
  • let an authority that everyone already trusts check the key and sign a statement about it.

Only the last one scales to a world of strangers. That signed statement is a certificate, and the system around it is PKI. The X.509 standard for internet certificates, RFC 5280, puts the goal in one line: users of a public key need “confidence that the associated private key is owned by the correct remote subject”.

What is a PKI made of?

The X.509 standard, RFC 5280 section 3, describes a PKI with five roles: the end entity (the user or system a certificate is about), the certification authority, an optional registration authority, the issuer of revocation lists, and a repository that stores and hands out certificates. Real PKIs add two more things that the standard takes for granted: the trust stores on every device, and the policies and audits that make a CA worth trusting.

The parts of a PKI: who issues, who holds and who checks a certificate Registration (RA) checks who is asking Policies and audits the rules for the CA approved requests rules Subscriber owns the key pair Certificate authority (CA) signs certificates Repository certificates, CRLs and OCSP Trust store the roots it trusts Relying party your browser or app sends certificate checks status
The parts of a PKI and how they connect. The subscriber gets a certificate; the relying party checks it.
Part What it does Learn more
Key pairs The private key signs and stays with its owner; the public key goes into the certificate Key pairs
Certificates Signed X.509 records that bind a public key to names for a fixed period X.509 certificate explained
Certificate authorities Check requests and sign certificates. A root CA signs intermediate CAs, which sign everyday certificates Trust stores
Registration authority Checks who is asking before the CA signs: a team, a system or an automated check such as ACME validation Domain validation
Repositories Publish certificates and revocation lists where clients can fetch them Certificate chains
Revocation Cancels a certificate before it expires, through revocation lists (CRLs) or OCSP Revocation
Trust stores The list of root certificates a device or app trusts, chosen by its vendor, its IT team or you Trust stores
Policies and audits Say what must be true and how a CA makes it true, with yearly audits for public CAs A CA of your own

Two more words you will meet everywhere. The subscriber is whoever owns the key and asked for the certificate, such as a website. The relying party is whoever checks the certificate and relies on it, such as your browser. For a closer look at each part, read PKI components.

Public PKI on the web also has Certificate Transparency: public, append-only logs of publicly trusted TLS certificates, which the major browsers require, so that a domain owner can spot a certificate they never asked for. Chapter 17, Certificate Transparency, shows how to watch them.

How PKI works, from key pair to padlock

Here is the life of one website certificate in seven steps. Each step links the chapter that explains it in depth, and How does PKI work? Step by step walks through it slowly.

  1. Make a key pair. The website’s owner generates a key pair on the server. The private key never leaves it, not even to the CA.
  2. Ask for a certificate. The owner sends the CA a certificate signing request (CSR): the public key, the names the certificate should cover, and a signature made with the private key, which proves the requester holds it. See Asking for a certificate.
  3. The CA checks the request. For a public website certificate, the CA checks that the requester controls each name, for example by asking them to publish a value in DNS or on the website, and it reads the domain’s CAA records. Some certificates also check the organisation. See Proving you own the name.
  4. The CA issues the certificate. It puts the public key, the names and a validity period into an X.509 certificate and signs it with its own private key. Publicly trusted TLS certificates are also logged in Certificate Transparency.
  5. The server sends its chain. When a browser connects, the server sends its certificate plus the intermediate CA certificates that link it to a root. Forgetting the intermediates is one of the most common causes of certificate errors, such as unable to get local issuer certificate.
  6. The client verifies. The browser builds a path from the certificate to a root in its trust store and checks every signature, the dates, that the website’s name is in the certificate’s Subject Alternative Name list, and what the certificate may be used for. It may also check whether the certificate was revoked. See Certificate chains and path validation.
  7. The connection is protected. In the TLS 1.3 handshake, both sides agree fresh session keys with an ephemeral key exchange (ECDHE). The server signs the handshake with its private key, which proves that it holds the key in the certificate. Fast symmetric encryption then protects the data. See The TLS 1.3 handshake.
How PKI works, in seven steps: from a key pair to an encrypted connection Server owner the subscriber Certificate authority the CA Client browser or app 1. Key pair private key stays here 2. CSR public key + names 3. CA checks you control the name 4. Certificate signed by the CA 5. Certificate + intermediates sent at the start of every connection 6. Client verifies chain to a trusted root, dates, name, status 7. ✓ Encrypted connection (TLS) The server signs the handshake with its private key, then fresh session keys encrypt the data.
Seven steps from a key pair to an encrypted connection. Steps 1 to 4 happen once per certificate; steps 5 to 7 happen on every connection.

Why does the client trust the root?

Step 6 ends at a root certificate, and a root signs its own certificate. Anyone can make a self-signed certificate in seconds, with any name. So a root is not trusted because it signed itself. It is trusted only because a copy of it is already in your device’s trust store, put there by your operating system or browser vendor, your IT team or you.

The chain of trust: a root in the trust store signs an intermediate, which signs the website's certificate Who signs whom Root CA key kept offline signs Intermediate CA issues certificates daily signs www.example.com the leaf certificate the client checks upwards On the client Trust store ✓ Root CA and the other roots that its vendor or IT team chose same root The server sends its leaf certificate + the intermediate (no need to send the root) ✓ Trusted: every signature checks out and the chain ends at a root that is already in the client's trust store. ✗ A root that signed itself but is not in the store earns no trust.
The chain of trust. The server proves the links; the trust store supplies the anchor.

Public roots get into trust stores through root programs run by Mozilla, Google, Apple and Microsoft. A CA must pass yearly audits and follow the CA/Browser Forum’s Baseline Requirements to stay in. Root keys are so valuable that they are usually kept offline, and everyday certificates come from intermediate CAs instead. Chapter 12, Who do we trust?, explains why different devices can disagree about the same certificate.

Where is PKI used?

The padlock in your browser is the best-known use, but the same machinery of key pairs, certificates and trusted roots does many other jobs. PKI use cases and examples goes through more of them.

  • HTTPS and the web. Public websites with https:// use certificates from publicly trusted CAs. This public system is often called the web PKI. It protects logins, payments and APIs, and your apps use it as much as your browser does.
  • Code signing. Windows, macOS, phones and package managers check signatures on apps, drivers and updates before they install or run them, so you know who published a file and that nobody changed it. Since 1 June 2023, the private keys of publicly trusted code signing certificates must be generated, stored and used in a hardware crypto module. See Signed and sealed.
  • Email. S/MIME signs email, to prove the sender, and encrypts it to the public key in the recipient’s certificate. Since 1 September 2023, the CA/Browser Forum S/MIME Baseline Requirements apply to every publicly trusted S/MIME certificate.
  • Mutual TLS. In mutual TLS the client shows a certificate too. Services inside data centres and Kubernetes clusters, banking APIs, and company Wi-Fi and VPNs use it so that machines can prove who they are without shared passwords. See Both sides show ID.
  • Devices. Many devices, from smart-home gadgets to payment terminals and cars, get a certificate at the factory, with the private key locked in secure hardware. Standards such as IEEE 802.1AR-2018 describe these device identities. See Machines with passports.
  • Documents and electronic signatures. Signed PDFs and contracts use certificates and trusted timestamps. In EU law, a qualified electronic signature shall have the equivalent legal effect of a handwritten signature (Regulation (EU) No 910/2014, Article 25(2)).

Is there just one PKI?

No. The PKI your browser uses is public: every mainstream device trusts it out of the box. Alongside it, many organisations run a private PKI of their own for internal systems, and each of those is a separate world of trust.

Public PKI Private PKI
Who trusts it Every mainstream browser and operating system, out of the box Only the devices you configure to trust your root
Who runs the CA A public CA that is in the root programs and audited every year Your organisation, or a managed service on its behalf
Rules CA/Browser Forum Baseline Requirements, root program policies, Certificate Transparency Your own certificate policy (CP) and practice statement (CPS)
Names Public domain names that you can prove you control Anything you decide: internal host names, devices, users, services
Typical use Public websites and APIs Internal services, mutual TLS, devices, Wi-Fi and VPN

The rule of thumb: if strangers connect, use a public CA. If you control every client, a private CA gives you freedom over names, lifetimes and templates, but you carry the job of guarding its keys. A self-signed certificate on a single server is not a private PKI. It has no CA, no revocation and no way to grow. Read Public vs private PKI to choose, PKI architecture for one-, two- and three-tier designs, and A CA of your own to build one.

What PKI is not

Many PKI mistakes start with one of these misunderstandings.

PKI is also not the same thing as TLS. TLS is the protocol that protects a connection, and PKI tells it whom it is talking to. PKI vs TLS explains how the two fit together.

Where is PKI heading?

Two big changes are under way.

Certificates live much shorter lives. For years, a publicly trusted TLS certificate could be valid for at most 398 days. Under CA/Browser Forum Ballot SC-081v3, that maximum falls in steps:

Issued from Maximum lifetime
15 March 2026 200 days
15 March 2027 100 days
15 March 2029 47 days

Short lifetimes limit the damage of a stolen key or a wrong certificate, because revocation alone does not reach every client. But renewing by hand every few weeks is not realistic, so automation with ACME becomes a must. Read ACME and the 47-day schedule, the dated overview in What’s changing in PKI, and the checklist How to prepare for short-lived certificates.

Quantum-safe cryptography is arriving. A large quantum computer would break RSA and elliptic-curve cryptography, the algorithms behind today’s certificates and key exchanges. NIST published the first post-quantum standards, FIPS 203 (ML-KEM), FIPS 204 (ML-DSA) and FIPS 205 (SLH-DSA), on 13 August 2024. Key exchange moved first, because recorded traffic could be decrypted later: X25519MLKEM768 hybrid post-quantum key exchange is on by default in Chrome, Firefox and Apple's operating systems (since late 2024 in Chrome 131 and Firefox 132). Certificates come next. Publicly trusted TLS certificates still use classical signatures such as RSA and ECDSA; post-quantum signatures are not yet allowed in them. Chapter 26, Post-quantum cryptography, explains what to do now, starting with an inventory of where your keys and algorithms live.

Why does PKI matter to a business?

Where to go next

Pick the line that fits you. Start here has a full path for each kind of reader.

The handbook, part by part. The PKI Handbook explains everything on this page in depth, in 26 chapters:

  1. Part I, Secrets: shared keys, key pairs and agreeing a secret in public.
  2. Part II, Proof: hashes, digital signatures and whose key it is.
  3. Part III, Certificates: X.509, names, CSRs and validation.
  4. Part IV, Trust and HTTPS: trust stores, chains, cross-signing and the TLS 1.3 handshake.
  5. Part V, When trust breaks: revocation, Certificate Transparency and famous failures.
  6. Part VI, Running PKI: renewal, ACME, guarding keys and a CA of your own.
  7. Part VII, Beyond the browser: mutual TLS, code and document signing, device identity.
  8. Part VIII, The future: post-quantum cryptography.

Look up any word in the glossary, or browse by subject in the topics. To put an idea into practice, try the guided learning path. The optional PKI Challenge uses fifteen short situations to help you find your starting point.

Free challenge · no account · progress saves hereTake the PKI Challenge — 10–15 minutes15 short trust decisions, explanations after each answer, and a result you can share.

Frequently asked questions

What does PKI stand for?

PKI stands for public key infrastructure. Public key refers to public-key cryptography, where everyone has a key pair: a public key they can share and a private key they keep secret. Infrastructure means everything built around those keys so that strangers can rely on them: certificate authorities, certificates, trust stores, revocation services, and the standards, policies and audits that hold it all together.

Is PKI the same as SSL/TLS?

No. TLS, the successor of SSL, is the protocol that protects a connection such as HTTPS. PKI is the system that tells the client whose key is at the other end. During the TLS handshake the server sends its certificate, the client checks it by PKI rules, and TLS then agrees fresh keys to encrypt the data. TLS without PKI would still encrypt, but you would not know who you are talking to.

Does PKI encrypt my data?

Not by itself. Certificates do not encrypt anything: they let a client check whose public key it has. The encryption comes from protocols that use PKI, such as TLS, S/MIME or a VPN. In TLS 1.3 both sides run a fresh, temporary key exchange (ECDHE) to agree session keys, the certificate's key only signs the handshake to prove who the server is, and fast symmetric encryption then protects the data.

What is the difference between a public key and a private key?

They are made together, as a pair. The private key stays secret with its owner and is used to sign, or to decrypt what was encrypted for that key pair. The public key can go to anyone and is used to check those signatures, or to encrypt for the owner. You cannot work out the private key from the public key. A certificate carries the public key, never the private key.

Who is in charge of PKI on the internet?

No single organisation. Certificate authorities issue certificates. Browser and operating system makers, such as Mozilla, Google, Apple and Microsoft, run root programs that decide which CAs your devices trust. The CA/Browser Forum writes the Baseline Requirements that publicly trusted CAs must follow, and independent auditors check them every year. The IETF publishes the technical standards, such as the X.509 certificate profile in RFC 5280.

Can I build my own PKI?

Yes. Many organisations run a private PKI for internal servers, staff laptops, devices and mutual TLS between services. Its certificates are trusted only by machines that you configure to trust its root. The usual design has an offline root CA and one or more online issuing CAs, with written policies and automated renewal. For a website that the public visits, use a publicly trusted CA instead.

Why do certificates expire?

A certificate records what a CA checked at one moment. Domains change hands, keys leak and rules improve, and revocation does not reach every client reliably. A limited lifetime caps how long a wrong or stolen certificate can be misused. The maximum lifetime of publicly trusted TLS certificates is falling in steps over the next few years, which is why automated renewal with ACME matters so much now.

Is PKI still safe now that quantum computers are coming?

PKI as a system stays; some of its algorithms will change. A large quantum computer would break RSA and elliptic-curve cryptography, which today's certificates and key exchanges use. Key exchange is moving first: hybrid post-quantum key exchange is already on by default in major browsers. Post-quantum signatures are standardised but not yet allowed in publicly trusted TLS certificates, so plan for crypto agility now.

Early edition. Written with AI assistance and checked against primary sources; an independent expert review is planned. Found a mistake? Tell us.

Last reviewed Edition 0.9