InfoSec Notes
Understanding PKI components including Certificate Authorities, digital certificates, certificate lifecycle, revocation, and how PKI enables trust on the internet.
What is PKI?
Public Key Infrastructure (PKI) is a framework of roles, policies, hardware, software, and procedures needed to create, manage, distribute, use, store, and revoke digital certificates. PKI binds public keys to identities, enabling trusted communication between parties who have never met.
| Registration | Certificate | Revocation | ||
|---|---|---|---|---|
| Authority (RA) | Repository | Service | ||
| - Verifies | - LDAP/HTTP | - CRL | ||
| applicant | - Distributes | - OCSP | ||
| identity | certificates |
PKI Ecosystem
v v v
v v
X.509 Certificate Structure
| | Version | v3 | |
| | Serial Number | 0x01A2B3C4... | |
| | Signature Algorithm | SHA256withRSA | |
| | Issuer | CN=DigiCert, O=DigiCert Inc, C=US | |
| | Validity | | |
| | Not Before | Jan 1, 2024 00:00:00 UTC | |
| | Not After | Jan 1, 2025 23:59:59 UTC | |
| | Subject | CN=www.example.com, O=Example Inc | |
| | Subject Public Key Info | | |
| | Algorithm | RSA (2048 bits) | |
| | Public Key | 30820122300d06092a86... | |
| | Extensions | | |
| | Subject Alt Names | example.com, *.example.com| |
| | Key Usage | Digital Signature, Key Encipherment| |
| | Extended Key Usage | TLS Web Server Auth | |
| | CRL Distribution Points | http://crl.digicert.com| |
| | Authority Info Access (OCSP) | http://ocsp...| |
| | CA Signature | RSA-SHA256 signature over above | |
Certificate Types
| Type | Validation Level | What's Verified | Visual Indicator |
|---|---|---|---|
| DV (Domain Validation) | Low | Domain ownership only | Padlock |
| OV (Organization Validation) | Medium | Domain + organization identity | Padlock + org name |
| EV (Extended Validation) | High | Domain + legal identity + physical address | Green bar (legacy) |
| Self-signed | None | Nothing (self-issued) | Browser warning |
Certificate Lifecycle
Certificate Lifecycle
========================
1. KEY GENERATION
Applicant generates key pair (private + public)
2. CERTIFICATE SIGNING REQUEST (CSR)
Applicant creates CSR containing
- Public key
- Subject information (domain, org)
- Signature (proves possession of private key)
3. IDENTITY VERIFICATION
CA/RA verifies applicant's identity
- DV: Domain control check (DNS/HTTP)
- OV: Business registration documents
- EV: Legal documents, physical verification
4. CERTIFICATE ISSUANCE
CA signs the certificate with CA's private key
Certificate published to repository
5. CERTIFICATE USE
Server presents certificate to clients
Clients verify signature chain to trusted root
6. CERTIFICATE RENEWAL
Before expiration, request new certificate
Re-verification may be required
7. CERTIFICATE REVOCATION (if compromised)
CA adds to CRL or OCSP responds "revoked"
Must happen immediately upon key compromise
Python: Working with Certificates
Certificate Revocation
CRL (Certificate Revocation List)
- CA publishes a signed list of revoked serial numbers
- Clients download periodically and check against it
- Drawback: Can be large and stale between updates
OCSP (Online Certificate Status Protocol)
- Real-time query to CA: "Is certificate #X still valid?"
- Response: Good / Revoked / Unknown
- OCSP Stapling: Server includes fresh OCSP response in TLS handshake
Interview Questions
- What is the difference between a CA, RA, and end entity in PKI?
- CA (Certificate Authority) issues and signs certificates. RA (Registration Authority) verifies the identity of certificate applicants before the CA issues the cert. End entities are users or servers that use certificates for authentication and encryption.
- What happens if a Certificate Authority is compromised?
- All certificates issued by that CA become untrustworthy. The CA's certificate is added to browsers' distrust lists, all issued certificates must be revoked and reissued by another CA. Historical example: DigiNotar (2011) was completely shut down after compromise.
- Explain the difference between CRL and OCSP for certificate revocation.
- CRL is a periodically published list of all revoked certificates (can be large, may be stale). OCSP provides real-time per-certificate status queries (fresher but requires connectivity). OCSP Stapling solves OCSP privacy and performance concerns by having the server fetch and cache the response.
- Why do browsers trust certificates from CAs they've never interacted with?
- Browsers ship with a pre-installed list of trusted root CA certificates (trust store). When a server presents a certificate signed by one of these roots (or its intermediates), the browser trusts it. This is called the "Web PKI trust model."
- What is Certificate Transparency and why was it introduced?
- CT requires CAs to publicly log all issued certificates to append-only logs. This allows domain owners to detect unauthorized certificates for their domains and provides public accountability for CAs. Introduced after incidents where CAs issued fraudulent certificates.
Summary
PKI is the trust infrastructure that makes secure internet communication possible. It binds public keys to verified identities through digital certificates, enabling TLS, code signing, email encryption, and document signing. Understanding PKI components, certificate lifecycle, and revocation mechanisms is essential for any security professional.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Public Key Infrastructure (PKI).
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Information Security topic.
Search Terms
information-security, information security, information, security, cryptography, public, key, infrastructure
Related Information Security Topics