PKI Fundamentals: Understanding Certificates, CAs, and Trust Chains
A practical guide to Public Key Infrastructure. Understand how certificates work, build trust hierarchies, and implement PKI for your organization.
Public Key Infrastructure (PKI) underpins virtually all secure internet communication. Every HTTPS connection, every S/MIME email, and every code signing operation relies on it. Yet most engineers treat certificates as magical incantations: copy the right commands from Stack Overflow and hope they work.
Once you understand PKI fundamentals, certificate management goes from frustrating guesswork to predictable operations. This guide covers how PKI works, starting with asymmetric cryptography basics and ending with enterprise PKI deployment.
The short answer: PKI binds public keys to identities. A certificate authority (CA) signs a certificate saying "this key belongs to example.com"; browsers and operating systems trust a small set of root CAs; and a chain of signatures from root to intermediate to your certificate lets anyone verify it. The practical work is keeping that chain complete, renewing before expiry, and in 2026, automating renewal: public TLS certificates now last at most 200 days, falling to 47 days by 2029.
The Trust Problem PKI Solves
When you connect to your bank's website, how do you know you're talking to your bank and not to an attacker who intercepted the connection?
Without PKI, you can't. The attacker could present their own encryption key, set up a connection that looks secure, and intercept everything. That's the classic man-in-the-middle attack.
Man-in-the-Middle Attack Without PKI:
- You request a connection to bank.com
- The attacker intercepts it and connects to the real bank
- The attacker sends YOU their public key (not the bank's)
- The bank sends the attacker its real public key
- You encrypt data with the attacker's key → attacker decrypts, re-encrypts with the bank's key, forwards
- The attacker reads all your banking data
PKI solves this by binding public keys to verified identities. A trusted third party (Certificate Authority) vouches that "this public key belongs to bank.com." Your browser trusts certain CAs, those CAs verify identities, and the chain of trust lets you confirm you're talking to the real bank.
Asymmetric Cryptography Primer
PKI relies on asymmetric (public key) cryptography. In symmetric encryption, both parties share the same secret key. Asymmetric cryptography uses key pairs:
| Key | Who Has It | Purpose |
|---|---|---|
| Private Key | Owner only (secret) | Sign messages, decrypt data |
| Public Key | Anyone (published) | Verify signatures, encrypt data |
The mathematical relationship between the two keys allows two fundamental operations:
Encryption: Anyone can encrypt data with your public key. Only you can decrypt it with your private key.
Signing: You sign data with your private key. Anyone can verify the signature with your public key.
Encryption (Confidentiality):
Sender encrypts plaintext message with recipient's public key → ciphertext → recipient decrypts with private key → plaintext message
Signing (Authentication):
Signer hashes document, signs hash with private key → signature → verifier checks signature with public key → valid ✓ or invalid ✗
Anatomy of a Certificate
A certificate is a signed document binding a public key to an identity. It contains:
X.509 Certificate Structure:
- Version: 3 (most common)
- Serial Number: Unique identifier
- Signature Algorithm: sha256WithRSAEncryption
- Issuer: Who signed this certificate
- CN=DigiCert Global G2 TLS RSA SHA256 2020 CA1
- O=DigiCert Inc, C=US
- Validity:
- Not Before: Oct 1 00:00:00 2026 GMT
- Not After: Apr 18 23:59:59 2027 GMT
- Subject: Who this certificate identifies
- CN=www.example.com
- O=Example Corp, L=San Francisco, ST=California, C=US
- Subject Public Key Info:
- Algorithm: RSA (2048 bit)
- Public Key: 30 82 01 0a 02 82 01 01 00 c7 85...
- Extensions:
- Subject Alternative Name (SAN): DNS:www.example.com, DNS:example.com
- Key Usage: Digital Signature, Key Encipherment
- Extended Key Usage: TLS Web Server Authentication
- Basic Constraints: CA:FALSE
- CRL Distribution Points: http://crl.digicert.com/...
- Signature: CA's cryptographic signature over all above data
- 5a 73 c4 89 a5 14 72 48 6f 3c d0 b6 77...
Key Fields Explained
| Field | Purpose |
|---|---|
| Subject | Entity the certificate identifies (your domain/org) |
| Issuer | CA that signed the certificate |
| Validity | Time period certificate is valid |
| Public Key | The actual cryptographic key |
| SAN | Additional domains/IPs the cert covers |
| Key Usage | What the key can be used for |
| Signature | CA's cryptographic signature proving authenticity |
Certificate Types by Validation Level
| Type | Validation | Indicators | Use Case |
|---|---|---|---|
| DV (Domain Validated) | Prove domain control | No organization name in cert | Basic websites |
| OV (Organization Validated) | Verify legal entity | Org name in cert | Business sites |
| EV (Extended Validation) | Extensive verification | Green bar (legacy) | Banks, e-commerce |
DV certificates are automated and instant (Let's Encrypt). OV and EV require manual verification of business documents.
The Chain of Trust
Browsers don't trust certificates directly. They trust Certificate Authorities, which are organizations vetted to verify identities and sign certificates.
Root CA (Trust Anchor)
- DigiCert Global Root G2
- Self-signed (issuer = subject)
- Validity: 25 years
- Embedded in browsers/OS trust stores
↓ Signs
Intermediate CA
- DigiCert Global G2 TLS RSA SHA256 2020 CA1
- Signed by: DigiCert Global Root G2
- Validity: 10 years
↓ Signs
End-Entity Certificate (Leaf)
- www.example.com
- Signed by: DigiCert Global G2 TLS RSA SHA256 2020 CA1
- Validity: 200 days at most (2026 limit)
- Your certificate
Verification: The browser walks the chain from leaf → intermediate → root. If the root is in the trust store, the entire chain is trusted.
Why Intermediates?
Root CA private keys are incredibly valuable, because compromising one compromises all certificates it ever issued. So roots are kept offline, in hardware security modules, and used only to sign intermediate CA certificates.
Intermediates handle day-to-day signing. If one is compromised, only its own certificates are affected, and it can be revoked without invalidating the root.
Trust Store Management
Operating systems and browsers maintain lists of trusted root CAs:
| Platform | Trust Store Location |
|---|---|
| Windows | Certmgr.msc → Trusted Root CAs |
| macOS | Keychain Access → System Roots |
| Linux | /etc/ssl/certs/ |
| Firefox | Built-in (independent of OS) |
| Chrome | Chrome Root Store (its own list, since 2022) |
| Java | cacerts keystore |
Enterprise environments often add internal CA roots to trust stores for internal applications.
Certificate Lifecycle
Generation
# Generate private key
openssl genrsa -out server.key 2048
# Generate CSR (Certificate Signing Request)
openssl req -new -key server.key -out server.csr \
-subj "/CN=www.example.com/O=Example Corp/C=US"
# View CSR contents
openssl req -in server.csr -noout -text
The CSR contains your public key and identity information. Send the CSR to the CA, and never the private key.
Validation
For DV certificates (Let's Encrypt, etc.), validation proves domain control:
| Method | How It Works |
|---|---|
| HTTP-01 | Place file at /.well-known/acme-challenge/ |
| DNS-01 | Create TXT record _acme-challenge.domain.com |
| TLS-ALPN-01 | Present special cert on port 443 |
For OV/EV, additional verification of business identity is required.
Issuance
The CA signs your CSR and returns the certificate. You'll typically receive:
- Your certificate (leaf/end-entity)
- Intermediate certificate(s)
- Root certificate (optional, usually not needed)
Deployment
Configure your server with the complete chain:
# Nginx configuration
server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate /etc/ssl/certs/example.com.crt; # Cert + chain
ssl_certificate_key /etc/ssl/private/example.com.key; # Private key
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
ssl_prefer_server_ciphers off;
}
The certificate file should contain your cert + intermediates (fullchain):
# Concatenate cert + intermediates
cat server.crt intermediate.crt > fullchain.crt
Renewal
Certificates expire, and faster every year. Under CA/Browser Forum Ballot SC-081, the maximum lifetime of a public TLS certificate fell from 398 days to 200 days in March 2026, drops to 100 days in March 2027, and reaches 47 days in March 2029. Manual renewal stops being viable well before then. Automate renewal before expiration:
# Let's Encrypt automatic renewal (certbot)
certbot renew --dry-run
# Add to crontab
0 0 * * * certbot renew --quiet
Revocation
When private keys are compromised, revoke the certificate:
| Method | Description |
|---|---|
| CRL (Certificate Revocation List) | Published list of revoked certs; now the main mechanism |
| OCSP (Online Certificate Status Protocol) | Real-time status check; being phased out by public CAs |
| OCSP Stapling | Server includes OCSP response in TLS handshake |
OCSP is on its way out for public certificates. Let's Encrypt shut down its OCSP responders in August 2025 and relies on CRLs, partly because OCSP lets a CA see which sites users visit. Short certificate lifetimes do much of the work revocation used to.
Common Certificate Problems
Incomplete Chain
The browser shows a certificate error even though the cert is valid. The usual cause is missing intermediates.
# Test certificate chain
openssl s_client -connect example.com:443 -showcerts
# Look for:
# depth=0 → your certificate
# depth=1 → intermediate
# depth=2 → root (may not be sent)
# Verify chain
openssl verify -CAfile /etc/ssl/certs/ca-certificates.crt -untrusted fullchain.pem fullchain.pem
Fix: Make sure your server sends the complete chain (cert + intermediates).
Name Mismatch
The certificate doesn't match the hostname being accessed.
# Check certificate names
openssl s_client -connect example.com:443 | openssl x509 -noout -text | grep -A1 "Subject Alternative Name"
Fix: Make sure the certificate includes all hostnames in SAN (Subject Alternative Name).
Expired Certificate
The certificate's validity period has passed.
# Check expiration
openssl s_client -connect example.com:443 | openssl x509 -noout -dates
Fix: Renew the certificate before it expires, and automate this.
Self-Signed Certificate
The certificate isn't signed by a trusted CA.
Fix: Use a certificate from a trusted CA for public services. Self-signed is acceptable for internal testing only.
Enterprise PKI
Organizations running internal applications often deploy private PKI:
Offline Root CA
- Internal Root CA
- Kept offline (air-gapped)
- HSM-protected private key
- Signs only intermediate CAs
- 20+ year validity
↓ Signs two Issuing CAs:
Issuing CA (Servers)
- Online
- Issues TLS certs for:
- Intranet sites
- Internal apps
Issuing CA (Users)
- Online
- Issues client certs for:
- User authentication
- VPN access
- S/MIME email
Deploying Internal CA
For internal PKI, options include:
| Solution | Complexity | Use Case |
|---|---|---|
| OpenSSL scripts | Low | Small scale, testing |
| step-ca | Medium | Modern internal PKI |
| EJBCA | High | Enterprise, compliance |
| Microsoft AD CS | Medium | Windows environments |
| HashiCorp Vault | Medium | DevOps/cloud native |
Trust Distribution
All clients must trust the internal root CA:
| Platform | Distribution Method |
|---|---|
| Windows (AD) | Group Policy |
| macOS | MDM profiles |
| Linux | Package, configuration management |
| Containers | Mount CA bundle |
| Mobile | MDM profiles |
PKI Best Practices
Key Management
| Practice | Reason |
|---|---|
| RSA 2048-bit minimum | 1024-bit is deprecated |
| ECDSA P-256 preferred | Smaller, faster, equally secure |
| HSM for CA keys | Tamper-resistant key storage |
| Rotate keys regularly | Limit exposure window |
Certificate Policies
| Policy | Recommendation |
|---|---|
| Validity period | Public TLS: 200 days max in 2026, shrinking to 47 days by 2029, so automate; internal PKI: as short as your automation allows |
| Key usage | Restrict to intended purpose |
| SAN vs CN | Use SAN; CN is deprecated |
| Wildcards | Avoid where possible |
Operational Security
- Automate renewal: Manual renewal leads to outages
- Monitor expiration: Alert 30+ days before
- Maintain inventory: Know every cert in your environment
- Plan for revocation: Have a process ready before compromise
- Audit regularly: Review trust stores and issued certs
Certificate Transparency
Certificate Transparency (CT) requires CAs to log all issued certificates publicly. This detects misissued certificates:
Certificate Transparency Flow:
- CA issues certificate → logs it to CT Log Server (append-only)
- Multiple monitors watch the CT logs
- If an unexpected certificate for your domain is detected → Alert triggered
Monitor CT logs for certificates issued to your domains:
- crt.sh (search interface)
- Cert Spotter (SSLMate)
- Meta's Certificate Transparency Monitoring
Pair CT monitoring with CAA records, which restrict which CAs may issue for your domain; the DNS security guide covers them.
Next Steps
With PKI knowledge, certificate management becomes methodical instead of mysterious. Start by understanding your current certificate inventory, then automate renewal and set up monitoring for expiration and CT alerts. Organizations implementing zero trust security will need solid PKI infrastructure to support certificate-based authentication; our zero trust guide for small businesses covers where device and identity checks fit. Certificates also underpin email transport security: MTA-STS only works if your mail servers present valid, trusted certificates.
We help organizations implement and manage PKI infrastructure through our security services. Request an assessment to evaluate your certificate management practices.
Put this into practice
Book a free 30-minute call with a senior engineer about your infrastructure, or check your email security in 30 seconds.
Related Articles
MTA-STS: Enforcing TLS for Email in Transit
How to implement MTA-STS to prevent email interception and downgrade attacks. Practical deployment guide with SMTP TLS Reporting.
Device Code Phishing in Microsoft 365: How to Block It
Device code phishing signs attackers into Microsoft 365 on the real login page, MFA and all. Find who uses the flow, then block it with Conditional Access.
Subdomain Takeover: How to Find and Fix Dangling DNS Records
A forgotten CNAME to a deleted bucket or app lets a stranger serve content on your domain. How to find dangling DNS records and retire services safely.
Get articles like this in your inbox
Practical security, infrastructure, and DevOps insights for teams in regulated industries. Sent every two weeks.