Public Key Infrastructure Explained Simply
Public key cryptography lets two parties communicate securely without a pre-shared secret. It leaves a puzzle, though. If someone hands you a public key and says "this belongs to your bank," how can you be sure? An attacker could just as easily hand you their own key with the same claim.
Public Key Infrastructure, usually shortened to PKI, is the set of people, rules, software and records that answers this question. It connects public keys to real identities in a way others can check. If you have ever visited a secure website, installed signed software or sent a signed email, you have relied on PKI.
The core idea
PKI works through a chain of vouching. A trusted party, called a certificate authority, checks that a key belongs to a particular person, device or organization. It then signs a document, called a certificate, that states this link. Anyone who trusts the authority can trust the certificate.
You can compare it with a passport. You do not know the border officer personally, but you trust the government that issued the document, and the document contains features that are hard to forge. The certificate authority plays the role of the government, and the certificate is the passport.
The main components
Certificate authority
A certificate authority (CA) issues and signs certificates. It guards its own private key with extreme care, because anyone who steals it could issue fake certificates that everyone trusts. Public CAs follow strict industry audits and rules. Organizations can also run private CAs for internal use, such as identifying company laptops or servers.
Registration authority
A registration authority (RA) handles the checking of identity, taking this job away from the CA. It confirms that the requester is who they claim to be before the CA signs anything. In small setups, one system may serve as both.
Certificates
A certificate binds an identity to a public key and carries the CA's signature, a validity period, and details about permitted uses. The standard format is X.509. Certificates are public documents, and sharing them is harmless.
Keys
Each certificate has a matching private key held by its owner. The security of the whole arrangement relies on that private key staying secret. Where the stakes are high, private keys are kept in hardware security modules or on smart cards, from which they cannot be copied out.
Repositories and revocation
Systems need to know when a certificate should no longer be trusted. CAs publish certificate revocation lists and run online status services so clients can check. This matters when a private key is lost or an employee leaves.
The trust hierarchy
Trust in PKI flows through levels.
- Root CA. The top of the structure. Its self-signed certificate is installed in operating systems, browsers and devices ahead of time, which is called a trust store.
- Intermediate CAs. Signed by the root, they do day-to-day issuing. If an intermediate is compromised, only it needs revoking, and the root can stay safely offline.
- End-entity certificates. The certificates for websites, people, servers or devices.
When your device checks a certificate, it follows the signatures up this path until it finds a root it trusts. If the chain is complete and valid, the certificate is accepted.
The life of a certificate
Certificates move through a cycle, and managing that cycle is a large part of running PKI.
- Key generation. The owner creates a key pair, and the private key stays with them.
- Request. The owner sends a certificate signing request containing the public key and identity details.
- Verification. The authority checks the identity or domain control.
- Issuance. The authority signs and returns the certificate.
- Use. The certificate is deployed for secure connections, signing or login.
- Renewal. A new certificate is issued before the old one expires.
- Revocation or expiry. The certificate is withdrawn or lapses.
Lost track of this cycle, and outages follow, because forgotten certificates expire without warning.
What PKI is used for
- Websites: HTTPS connections rely on certificates issued by public CAs.
- Email: signing and encrypting messages with S/MIME.
- Code signing: proving that software came from a known publisher and was not modified.
- Device identity: verifying laptops, phones and network equipment before they join a network.
- Document signing: legally meaningful electronic signatures in many regions.
- VPNs and Wi-Fi: certificate-based authentication that avoids passwords.
Public and private PKI
Public PKI serves the open internet. Browsers decide which CAs they trust, and those CAs must meet published requirements. Private PKI serves an organization's internal needs. The organization controls the CA, decides who gets certificates and installs its root on its own devices. Private PKI gives more control and customization, but it also makes the organization responsible for running it securely.
Where PKI goes wrong
- Weak protection of the CA key. The compromise of a CA undermines everything beneath it.
- Poor inventory. Teams lose track of how many certificates exist and when they expire.
- Slow revocation. Clients that never check revocation status keep trusting cancelled certificates.
- Excessive trust. Installing unknown roots in a trust store widens who can vouch for what.
- Manual processes. Hand-managed renewals cause mistakes. Automation reduces them considerably.
Good practices
- Keep root CA keys offline and use intermediates for daily issuing.
- Use short certificate lifetimes and automated renewal where the tooling allows.
- Keep a searchable inventory of every certificate, its owner and its expiry date.
- Restrict who can request and approve certificates.
- Document how you would respond if a CA key or server key were compromised, and practice it.
Frequently Asked Questions
Is PKI the same as a certificate authority?
No. A certificate authority is one component. PKI is the whole system around it, including the keys, the certificates, the rules for issuing them, the revocation methods and the software that checks everything. The CA is the trust anchor at its center.
Who decides which CAs I trust?
Your operating system or browser vendor maintains a trust store of root certificates, based on public requirements and audits. Organizations can add their own roots to managed devices. Be cautious about installing a root certificate manually, since it lets that authority vouch for any site.
Why does PKI need revocation if certificates expire anyway?
Expiry can be months away, and a stolen private key can be abused in the meantime. Revocation lets the issuer cancel trust early. Shorter lifetimes reduce the problem further, because the window of exposure shrinks even if revocation checking is imperfect.