What Is Public Key Infrastructure (PKI)?

PKI is the trust framework that secures the internet. It enables encrypted connections, verified identities, and tamper-proof digital signatures — all built on certificates and cryptographic keys.

PKI: The Foundation of Digital Trust

Public Key Infrastructure (PKI) is the set of technologies, policies, and procedures that manage digital certificates and public-private key pairs. Every time you visit a website over HTTPS, sign an email, or verify a software update, PKI is working behind the scenes to ensure the connection is encrypted and the other party is who they claim to be.

Without PKI, there would be no way to distinguish a legitimate bank website from a phishing site, no way to verify that a software update actually came from its vendor, and no way to send encrypted email to someone you have never met in person. PKI solves the fundamental problem of establishing trust between parties that have no prior relationship.

At its core, PKI relies on asymmetric cryptography: every participant has a key pair consisting of a public key (shared openly) and a private key (kept secret). Data encrypted with the public key can only be decrypted with the corresponding private key, and a digital signature created with the private key can be verified by anyone with the public key.

How PKI Works: Certificates, Keys, and Trust

The key insight of PKI is that a certificate authority (CA) — a trusted third party — vouches for the binding between a public key and an identity. Here is how the process works in practice:

  1. Key pair generation. An entity (a web server, a person, a device) generates a public-private key pair. The private key is stored securely; the public key is embedded in a certificate signing request (CSR).
  2. Certificate signing request. The entity sends the CSR to a certificate authority. The CSR contains the public key, the subject identity (such as a domain name), and a digital signature proving possession of the private key.
  3. Validation. The CA verifies the requester's identity. For a domain-validated (DV) TLS certificate, this might be as simple as proving control of the domain. For an extended-validation (EV) certificate, it involves legal and organizational checks.
  4. Certificate issuance. The CA signs the certificate with its own private key, creating a cryptographic binding between the subject's public key and their identity. The signed certificate is returned to the requester.
  5. Chain of trust verification. When a client (browser, email client, operating system) encounters the certificate, it traces the chain of signatures back to a root CA that it already trusts. If the chain is valid and the certificate has not been revoked, the identity is accepted.

This chain of trust is what makes PKI scalable. Browsers and operating systems ship with a pre-installed set of trusted root CA certificates. Any certificate that chains back to one of these roots is automatically trusted, without the end user needing to make a manual decision.

PKI Components: Root CAs, Intermediates, and More

A well-architected PKI deployment consists of several layers and components:

X.509 Certificates Explained

The X.509 standard defines the format for PKI certificates used across TLS, S/MIME, code signing, and most other PKI applications. An X.509 certificate contains:

Subject Alternative Names (SANs) are particularly important for TLS certificates. SANs allow a single certificate to cover multiple domain names and IP addresses. Modern browsers require the domain to appear in the SAN field, not just the Subject CN.

PKI Use Cases

TLS/HTTPS: Securing Web Traffic

The most visible use of PKI is TLS (Transport Layer Security), which powers HTTPS. When you connect to a website, the server presents its X.509 certificate. Your browser verifies the chain of trust, confirms the certificate covers the requested domain, and establishes an encrypted session. Over 95% of web traffic now uses HTTPS, making PKI certificates essential infrastructure.

Code Signing

Software publishers use code signing certificates to prove that executables, drivers, and packages have not been tampered with since they were built. Operating systems check code signatures before running software, warning users or blocking unsigned code entirely. In enterprise environments, code signing keys often require multi-party approval to prevent a single compromised developer from distributing malicious updates.

Email Security with S/MIME

S/MIME (Secure/Multipurpose Internet Mail Extensions) uses PKI certificates to sign and encrypt email. A signed email proves the sender's identity and that the message was not altered in transit. An encrypted email can only be read by the intended recipient. Organizations that handle sensitive communications rely on S/MIME as part of their security policy.

Document and Contract Signing

Digital signatures on PDFs, contracts, and legal documents provide non-repudiation: the signer cannot later deny having signed. Regulatory frameworks like eIDAS in the European Union define legally binding electronic signatures that depend on PKI certificates issued by qualified trust service providers.

Mutual TLS (mTLS)

Standard TLS authenticates only the server. Mutual TLS adds client certificate authentication, so both sides verify each other's identity. mTLS is widely used in microservices architectures (Istio, Linkerd), API gateways, and zero trust networks. It eliminates the need for API keys or tokens for machine-to-machine authentication.

IoT Device Identity

IoT devices use PKI certificates provisioned at manufacturing time to establish unique, hardware-bound identities. These certificates enable secure device onboarding, encrypted communication, and firmware update verification. Combined with TPM chips, device certificates can be tied to tamper-resistant hardware.

PKI and HSMs: Why Hardware Key Protection Matters

The security of any PKI deployment is only as strong as the protection of its CA private keys. If an attacker obtains a CA's private key, they can issue fraudulent certificates for any domain or identity, completely undermining trust.

This is why every major certificate authority — and every organization running a private CA — stores CA signing keys in a Hardware Security Module (HSM). An HSM is a dedicated cryptographic device that generates, stores, and uses private keys in tamper-resistant hardware. The private key never leaves the HSM in plaintext, so even full server compromise cannot extract it.

Why HSMs Are Required for CA Operations

Industry standards mandate hardware key protection for certificate authorities. The CA/Browser Forum Baseline Requirements require that CA signing keys be generated and stored in hardware meeting at least FIPS 140-2 Level 3 or Common Criteria EAL 4+. Compliance frameworks including PCI DSS, SOC 2, and eIDAS all require hardware-backed key protection for certificate issuance.

Traditional HSMs from vendors like Thales (Luna) and Entrust (nShield) cost tens of thousands of dollars and require specialized infrastructure. Cloud HSM services (AWS CloudHSM, Azure Dedicated HSM, Google Cloud HSM) reduce the operational burden but introduce per-key and per-operation fees, and your keys reside on someone else's hardware.

How TPM HSM Supports PKI

TPM HSM provides a practical alternative for organizations that need hardware-backed PKI without the cost and complexity of traditional HSMs. It turns the TPM 2.0 chip already built into your servers and workstations into a fully functional HSM for PKI operations.

CSR Generation from Hardware-Protected Keys

TPM HSM generates PKCS#10 Certificate Signing Requests directly from keys stored in the TPM. The private key never leaves the chip — the CSR is built around the TPM-resident public key with full support for subject distinguished names and Subject Alternative Names. You submit the CSR to any CA (public or private) and receive a certificate that is cryptographically bound to a hardware-protected key.

Certificate Storage and Chain Management

TPM HSM stores X.509 certificates and associates them with their corresponding TPM-resident keys. You can import full certificate chains (root, intermediate, and end-entity) and manage them alongside your HSM keys. This gives you a unified view of your PKI assets with hardware-backed key protection.

Hardware-Backed CA Signing Keys

When running a private certificate authority, TPM HSM protects your CA signing keys inside the TPM. Combined with hardware-enforced signing policies, the TPM itself refuses unauthorized signing operations. Even if the CA server is compromised, the attacker cannot extract the CA key or forge certificates without satisfying the TPM's policy requirements.

Multi-Party Certificate Issuance

For high-security PKI deployments, TPM HSM supports M-of-N threshold signing for CA keys. Certificate issuance requires approval from multiple authorized parties, each authenticating with their own YubiKey or file key. This prevents a single compromised administrator from issuing rogue certificates — a critical control for root and intermediate CA operations.

Remote Attestation for PKI Trust

TPM HSM can attest that your CA keys are genuinely stored in real TPM hardware, not in a software emulator. This provides cryptographic proof to auditors and relying parties that your PKI meets hardware key protection requirements, supporting compliance with CA/Browser Forum standards and regulatory frameworks.

Frequently Asked Questions About PKI

What is PKI in simple terms?

PKI (Public Key Infrastructure) is a system of digital certificates, certificate authorities, and cryptographic keys that lets people and machines verify each other's identity online. It is the trust framework behind HTTPS, email encryption, code signing, and many other security technologies.

What is the difference between a root CA and an intermediate CA?

A root CA is the top-level certificate authority whose self-signed certificate is pre-installed in browsers and operating systems. An intermediate CA is signed by the root CA and is used to issue end-entity certificates. This separation protects the root key — it can be kept offline while the intermediate CA handles day-to-day certificate issuance.

Why do certificate authorities need HSMs?

A certificate authority's private key is the root of all trust it issues. If that key is compromised, every certificate it has ever signed becomes untrustworthy. HSMs (Hardware Security Modules) store CA keys in tamper-resistant hardware so the private key never exists in software or on disk, making extraction practically impossible even if the server is compromised.

What is an X.509 certificate?

An X.509 certificate is a standardized digital document that binds a public key to an identity (such as a domain name, organization, or person). It contains the subject's public key, issuer information, validity period, serial number, and extensions like Subject Alternative Names (SANs). X.509 is the format used by TLS/HTTPS, S/MIME email, and code signing.

How does TPM HSM support PKI?

TPM HSM provides hardware-backed PKI capabilities using the TPM 2.0 chip in your machine. It supports CSR generation from TPM-protected keys, X.509 certificate storage and chain management, hardware-enforced signing policies for CA operations, and multi-party threshold signing so no single person can issue certificates alone.

Build Hardware-Backed PKI With TPM HSM

Protect your CA keys in real hardware. Open source, zero cost, and ready to deploy.

View on GitHub Learn About TPM HSM