Skip to main content

    What Is PKI? How Public Key Infrastructure Works

    PKI is the system of keys, certificates and CAs that lets software trust a public key it has never seen. How it works, tested on a PKI we built in OpenSSL.

    MS
    My-SSL
    ·
    11 min read
    ·
    Published November 8, 2024
    ·
    Last updated November 19, 2026

    The short answer

    Public key infrastructure (PKI) is the set of roles, rules and software that lets a computer trust that a public key belongs to a named website, person or company. A certificate authority signs a certificate binding the key to the name, the client checks that signature up a chain to a root it already trusts, and revocation lists tell it which certificates to stop trusting. A public website certificate issued today may be valid for at most 200 days.

    How a PKI decides whether to trust a certificateA root CA in the trust store signs an issuing CA limited to pathlen 0, which signs the server certificate. OpenSSL results on November 19, 2026: full chain OK; intermediate missing error 20; revoked error 23; extra CA error 25.One chain, four checksOpenSSL 3.0.13, November 19, 2026Root CA in the trust storeIssuing CA, pathlen:0Server certificateWhat the client concludedFull chain, root trustedOKIntermediate not senterror 20Certificate on the CRLerror 23Extra CA below the issuing CAerror 25
    Trust in a PKI is all-or-nothing per chain: one missing intermediate, one revocation entry or one CA where the rules allow none, and the same certificate stops being accepted.

    Updated November 19, 2026: rewritten around a test PKI we built and broke with OpenSSL, the revocation rules in version 2.3.1 of the Baseline Requirements, and the 2026 to 2029 certificate lifetime schedule. Removed statements we could not trace to a current primary source.

    How does PKI work?

    PKI works by having a trusted third party vouch for a public key. The key owner keeps a private key secret and publishes the matching public key inside a certificate. A certificate authority checks the owner and signs that certificate. Anyone who trusts the authority can then check the signature and accept the key as belonging to the name in the certificate.

    What PKI adds to the cryptography is the answer to "whose key is this?". Without it, an attacker in the middle of a connection could hand you their own public key and you would have no way to tell. Our guide to symmetric and asymmetric encryption covers the key maths if you want it.

    Many explanations say the server's public key encrypts your data. In TLS 1.3 that is no longer how it works. RFC 8446 removed static RSA and Diffie-Hellman key exchange, so every connection agrees a fresh session key instead. The certificate's key is used to sign: the server sends a CertificateVerify message, "a signature over the entire handshake using the private key" that matches the certificate. PKI proves who is on the other end; the session keys do the encrypting.

    What are the parts of a PKI?

    A working PKI has six parts: key pairs, certificates, a certificate authority that signs them, a registration authority that checks applicants, a place to publish revocation data, and a trust store on every client listing the roots it accepts. Without the RA nobody checks who is asking, without revocation data clients cannot stop trusting a bad certificate, and without a trust store they cannot check anything.

    PartWhat it doesIn a public website PKI
    Key pairPrivate key signs; public key lets others check the signatureGenerated by you; the CA only sees the public key in your CSR
    Certificate (X.509)Binds a public key to names, dates and allowed usesPublic domain names or public IP addresses; internal names and reserved IPs are not allowed
    Certificate authoritySigns certificates with a root or issuing CA keyAudited and bound by the Baseline Requirements
    Registration authorityChecks the applicant; never signsOften a team inside the CA rather than a separate company
    Revocation dataLists certificates that must no longer be trustedCRLs required; OCSP optional since March 15, 2024
    Trust storeThe roots a client accepts, and for which purposesMaintained by Chrome, Mozilla, Apple and Microsoft

    The registration authority is the part most often described wrongly. The Baseline Requirements define it as an entity that handles "identification and authentication" of applicants but "is not a CA, and hence does not sign or issue Certificates", and add that the role "can be part of the CA". An RA is not a subordinate CA. The certificate itself is unpacked field by field in X.509 certificates explained.

    What is the chain of trust in a PKI?

    The chain of trust is the series of signatures that links your certificate to a root certificate the client already holds. The root signs an issuing (intermediate) CA, the issuing CA signs your certificate, and the client checks each signature in turn. If every link verifies and the root is in its trust store, the client trusts your certificate.

    Roots sign rarely: the Baseline Requirements say a root may sign only when an authorized person "deliberately issue[s] a direct command", so the issuing CA does the daily signing. Root programs also push CAs to separate issuing CAs by purpose. Microsoft's program says "a separate intermediate must be used for each use case", such as server authentication, S/MIME and code signing, so a website certificate and a code signing certificate from the same CA hang off different intermediates.

    Two fields in a CA certificate limit how far a chain can grow. CA:TRUE marks it as allowed to sign certificates, and the path length constraint, in the words of RFC 5280, gives "the maximum number of non-self-issued intermediate certificates that may follow" it. An issuing CA with pathlen:0 can still sign a certificate marked CA:TRUE, but nothing that second CA signs will verify, because no further intermediate may follow it. Our SSL certificate chain guide shows how to see and repair the chain your own server sends, and the AIA extension guide covers how some clients fetch a missing intermediate on their own.

    What happens when a PKI check fails? (tested)

    When any link in the chain fails, the client rejects the certificate outright; there is no partial trust. We built a three-level PKI with OpenSSL 3.0.13 on Ubuntu 24.04.5 on November 19, 2026 and broke it three different ways. Each break produced a different error code from the same verification command.

    The setup: an EC P-256 root CA valid for 3,650 days; an issuing CA marked CA:TRUE, pathlen:0 with the server authentication purpose, valid for 1,825 days; and a server certificate for shop.example.test marked CA:FALSE, valid for 199 days. The working case first, then the missing intermediate:

    $ openssl verify -CAfile root.pem -untrusted int.pem leaf.pem
    leaf.pem: OK
    
    $ openssl verify -CAfile root.pem leaf.pem
    CN = shop.example.test
    error 20 at 0 depth lookup: unable to get local issuer certificate
    error leaf.pem: verification failed

    Next we revoked the server certificate with reason keyCompromise, published a CRL from the issuing CA (next update set seven days ahead) and asked OpenSSL to check revocation at every level. Last, we used the issuing CA to sign a second CA and had that second CA sign a certificate for evil.example.test, a path that pathlen:0 does not allow:

    $ openssl verify -crl_check_all -CAfile root.pem -untrusted int.pem -CRLfile crls.pem leaf.pem
    CN = shop.example.test
    error 23 at 0 depth lookup: certificate revoked
    error leaf.pem: verification failed
    
    $ openssl verify -CAfile root.pem -untrusted int-and-sub.pem leaf2.pem
    CN = Demo TLS Issuing CA
    error 25 at 2 depth lookup: path length constraint exceeded
    error leaf2.pem: verification failed
    What we brokeOpenSSL resultWhat it means on a real server
    NothingOK, exit 0Chain complete, root trusted
    Intermediate not suppliederror 20, exit 2The server sends only its own certificate; fix the chain file
    Certificate on the CRLerror 23, exit 2The CA has revoked it; reissue with a new key
    Extra CA added below the issuing CAerror 25, exit 2A CA exceeded its authority; nothing under it is accepted

    The last result is the one that makes PKI safe to delegate. The rogue CA's signature was cryptographically valid, and the certificate it signed still failed, because the constraint sits in a certificate the root had signed. We did not test OCSP or a browser's own chain building, which can differ from OpenSSL.

    How does a PKI take trust back?

    A PKI takes trust back by revoking the certificate and publishing that fact where clients look. For public website certificates, the CA/Browser Forum sets the clock: the CA must revoke within 24 hours when, for example, the private key is compromised, and must publish an updated certificate revocation list (CRL) within 24 hours of recording the revocation.

    Even with no revocations, a CA issuing website certificates must publish a fresh CRL at least every seven days if all its certificates carry an OCSP pointer, and every four days otherwise. OCSP, the per-certificate status lookup, has been optional since version 2.0.1 of the Baseline Requirements took effect on March 15, 2024, and Let's Encrypt turned its OCSP service off on August 6, 2025, citing the privacy cost of telling a CA which sites people visit. The trade-offs between the two methods are in CRL vs OCSP.

    Revocation also explains why the owner of a private key carries part of the PKI's security. The CA can only revoke what it is told about, so a leaked key that nobody reports stays trusted until the certificate expires.

    Public PKI or private PKI: which do you need?

    Use a public PKI when people or devices you do not manage must trust the certificate: visitors to a website, users installing your software, recipients of your signed email. Use a private PKI when you control every client and can install your own root on them, for example internal services, VPN clients or machine-to-machine traffic inside your own network.

    Public PKIPrivate PKI
    Who trusts the rootEvery client whose root program includes it (November 19, 2026: Chrome 100 roots for websites, Mozilla 112, Apple 117, Microsoft 204)Only devices where you install the root yourself
    RulebookCA/Browser Forum requirements plus each root program's policy, auditedYour own policy
    Names allowedPublic domain names; no internal names or reserved IP addressesAnything your clients accept, such as db01.corp.internal
    Maximum TLS lifetime200 days now, 47 days from March 15, 2029Whatever you set
    RevocationCRL required, updated within 24 hours of a revocationYour design; every client must be able to reach it

    The two often run side by side: a public certificate on the website, a private PKI behind it. Two rules of thumb hold. If you would have to ask strangers to install your root, you need a public certificate. If the names you need end in something like .internal or .local, no public CA may issue for them, so you need a private one. For the public side, the SSL certificates we sell, issued by Certum, come in DV, OV and EV, and a self-signed certificate is the one-certificate version of a private PKI for testing.

    How long do PKI certificates last?

    In a public PKI the maximum lifetime depends on what the certificate is for. A website (TLS) certificate issued since March 15, 2026 may be valid for at most 200 days, a code signing certificate issued since March 1, 2026 for at most 460 days, and a strict or multipurpose S/MIME email certificate for at most 825 days.

    Maximum validity of a public TLS certificate, 2026 to 2029398 days before March 15, 2026; 200 days from March 15, 2026; 100 days from March 15, 2027; 47 days from March 15, 2029.Maximum TLS validityIssued before Mar 15, 2026398 daysFrom Mar 15, 2026200 daysFrom Mar 15, 2027100 daysFrom Mar 15, 202947 daysSource: CA/Browser Forum BR 6.3.2
    By 2029 a public website certificate will live less than an eighth as long as one issued in early 2026, so the renewal step of a PKI has to be automated rather than remembered.

    The website limit keeps falling: 100 days from March 15, 2027 and 47 days from March 15, 2029. Shorter lifetimes shrink the window in which a stolen key or a stale validation can be abused, at the price of more frequent renewals. What that means for your renewal process is covered in the 200-day certificate lifetime, and the wider picture for buyers in our SSL certificates guide for 2026.

    Frequently Asked Questions

    Quick answers to related questions.

    Is PKI the same as SSL/TLS?

    No. TLS is the protocol that sets up an encrypted connection; PKI is the trust system TLS relies on to decide whether the server's certificate really belongs to the site you typed. The same PKI machinery, with different rules and different roots, also backs code signing and S/MIME email certificates.

    What is an everyday example of PKI?

    Opening any HTTPS website. Your browser receives the site's certificate and intermediate, checks each signature up to a root in its trust store, checks the name and dates, and only then finishes the TLS handshake. Installing a signed Windows program is another: Windows checks the publisher's code signing certificate against the roots Microsoft trusts for code signing.

    Who controls the public web PKI?

    No single body. Certificate authorities operate the roots, the CA/Browser Forum writes the Baseline Requirements they must follow, and four root programs (Chrome, Mozilla, Apple and Microsoft) decide which roots their software trusts. In the Common CA Database report of November 19, 2026, Chrome included 100 roots for websites and Microsoft 204.

    Does a PKI need OCSP?

    Not for publicly trusted TLS certificates. Since version 2.0.1 of the Baseline Requirements took effect on March 15, 2024, OCSP is optional and certificate revocation lists are required. Let's Encrypt turned its OCSP service off on August 6, 2025. A private PKI can use either, as long as every client can reach the revocation data it is told to check.

    Still Have Questions?

    Contact our support team with questions about certificates, installation, or technical issues.

    Need a certificate from the public PKI?

    Compare DV, OV and EV on the SSL certificates page, or see code signing certificates if you publish software for Windows. Both are issued by Certum.