Skip to content

PKI Fundamentals

This document covers the foundational concepts of Public Key Infrastructure (PKI). If you’re new to PKI or need a refresher, start here before diving into QPKI operations.

Public Key Infrastructure (PKI) is a framework for managing digital identities and securing communications using cryptographic keys and certificates.

PKI answers three fundamental questions:

  • Who are you? (Authentication)
  • Can I trust you? (Trust chain verification)
  • Is this message really from you? (Digital signatures)

When two parties communicate over the internet, they face a challenge: how can Alice be sure she’s really talking to Bob, and not an imposter?

PKI solves this by introducing a trusted third party (the Certificate Authority) that vouches for identities through digital certificates.


A digital certificate is an electronic document that binds a public key to an identity (person, server, organization). Think of it as a digital passport issued by a trusted authority.

A certificate states: “This public key belongs to this identity, and I (the CA) vouch for it.”

Certificates follow the X.509 standard (RFC 5280). Key fields:

FieldDescriptionExample
SubjectWho the certificate is issued toCN=www.example.com, O=ACME Corp
IssuerWho signed the certificateCN=ACME Root CA
ValidityWhen the certificate is validNot Before: 2025-01-01, Not After: 2026-01-01
Public KeyThe subject’s public keyECDSA P-256, RSA 2048, ML-DSA-65…
Serial NumberUnique identifier within the CA0x03
ExtensionsAdditional constraints and informationKey Usage, SANs, CRL URLs…
SignatureCA’s digital signature over all fieldsProves authenticity
TypeDescriptionExample
Root CASelf-signed, trust anchorCorporate Root CA
Intermediate/Issuing CASigned by Root, issues end-entity certsIssuing CA
End-EntityThe final certificate for a service/userTLS server, code signing

PKI uses asymmetric cryptography with key pairs:

KeyWho Has ItPurpose
Private KeyOnly the owner (kept secret)Sign data, decrypt messages
Public KeyAnyone (in certificate)Verify signatures, encrypt messages

The mathematical relationship between the keys ensures:

  • Only the private key can create valid signatures
  • Only the private key can decrypt messages encrypted with the public key
  • The private key cannot be derived from the public key
TypePurposeAlgorithms
SignatureSign certificates, documents, codeECDSA, RSA, Ed25519, ML-DSA, SLH-DSA
Key EncapsulationEstablish shared secrets for encryptionECDH, RSA, ML-KEM

Private keys must be protected. Common storage options:

StorageSecurityUse Case
File (PEM/DER)LowDevelopment, testing
Encrypted file (PKCS#8)MediumProduction with passphrase
HSM (PKCS#11)HighEnterprise, compliance

A Certificate Authority (CA) is a trusted entity that issues and signs certificates. The CA vouches for the identity of certificate subjects.

Most PKIs use a hierarchical structure:

Root CA (offline, trust anchor)
├── Issuing CA A (online, issues TLS certs)
│ ├── www.example.com
│ └── api.example.com
└── Issuing CA B (online, issues code signing certs)
└── Developer certificate
CA TypeDescriptionTypical Validity
Root CASelf-signed, kept offline, trust anchor20+ years
Issuing CASigned by Root, issues end-entity certs5-10 years
  • Security: Root CA stays offline (air-gapped), protected from compromise
  • Flexibility: Multiple Issuing CAs for different purposes
  • Revocation: Compromise of Issuing CA doesn’t require replacing the Root

A Certificate Signing Request (CSR) is a message sent to a CA to request a certificate. It contains:

  1. The subject’s public key
  2. The requested identity (subject name, SANs)
  3. A signature proving the requester owns the private key
1. Generate key pair → private.key + public key
2. Create CSR → request.csr (includes public key + identity)
3. Submit CSR to CA → CA verifies identity
4. CA issues certificate → certificate.crt (signed by CA)
5. Deploy certificate → Use with private key

The private key never leaves the requester’s system.


A trust chain connects an end-entity certificate back to a trusted root:

End-Entity Certificate (www.example.com)
↓ signed by
Issuing CA Certificate
↓ signed by
Root CA Certificate (trusted)

When verifying a certificate, the verifier:

  1. Checks the signature on the end-entity cert (using Issuing CA’s public key)
  2. Checks the signature on the Issuing CA cert (using Root CA’s public key)
  3. Confirms the Root CA is in the local trust store
  4. Validates dates, extensions, and revocation status

If any step fails, the certificate is rejected.

Operating systems and browsers maintain trust stores containing trusted Root CA certificates:

PlatformTrust Store Location
macOSKeychain
WindowsCertificate Store
Linux/etc/ssl/certs/
BrowsersBuilt-in + OS trust store

Issue Use Renew/Revoke Expire
│ │ │ │
▼ ▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ Created │───▶│ Active │────────▶│ Revoked │ or │ Expired │
└─────────┘ └─────────┘ └─────────┘ └─────────┘

When a certificate must be invalidated before expiry (key compromise, employee departure):

MethodDescriptionProsCons
CRLSigned list of revoked serial numbersSimple, offline verificationCan grow large, update delay
OCSPReal-time status check via HTTPCurrent status, small responsesRequires online responder

FormatDescriptionUse Case
PEMBase64 with -----BEGIN/END----- headersText files, human-readable
DERBinary ASN.1Compact, machine processing
ExtensionContentFormat
.crt, .cer, .pemCertificatePEM or DER
.keyPrivate keyPEM
.csrCertificate Signing RequestPEM
.p12, .pfxCertificate + private key bundlePKCS#12 (binary)
.crlCertificate Revocation ListPEM or DER

Certificate:

-----BEGIN CERTIFICATE-----
MIIBkTCB+wIJAKHBfpegPqAOMA0GCSqGSIb3DQEBCwUAMBExDzAN...
-----END CERTIFICATE-----

Private Key:

-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg...
-----END PRIVATE KEY-----