0Pricing
Cloud & IT Cert Prep · Lesson

Certificate Lifecycle and Revocation

Follow a certificate from issuance through renewal to revocation, and learn how CRL and OCSP communicate revocation status in real time.

Certificate Lifecycle and Revocation is a free Cloud & IT Cert Prep lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cloud & IT Cert Prep learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The Certificate Lifecycle

Every digital certificate follows a defined lifecycle from creation to retirement. The stages are: Request and Enrollment (generate key pair, create CSR), Issuance (CA validates and signs), Deployment (install on server or device), Use (active operational period), Renewal (before expiry), and Revocation or Expiry (end of life). Managing this lifecycle at scale — especially in enterprises with thousands of certificates — requires automation and certificate lifecycle management (CLM) tools, as manual tracking inevitably leads to expired certificates causing outages.

Certificate Signing Request (CSR)

The certificate lifecycle begins with a Certificate Signing Request (CSR). The requestor generates a key pair, then creates a CSR that contains the public key, subject information (CN, O, C), and is signed with the private key (proving ownership of the private key without revealing it). The CSR is submitted to the CA, which validates the requestor's identity and, if approved, signs the certificate. The private key never leaves the requestor's possession. CSR generation is the critical step where key strength is determined — using a minimum of 2048-bit RSA or 256-bit ECC.

# Complete CSR generation workflow
# Step 1: Generate private key (RSA 2048)
openssl genrsa -out server.key 2048

# Step 2: Create CSR with all required fields
openssl req -new -key server.key -out server.csr \
  -subj '/CN=www.example.com/O=Example Corp/OU=IT/C=US/ST=CA/L=San Jose'

# Step 3: Verify CSR content before submitting
openssl req -in server.csr -noout -text | grep -A5 'Subject'

Certificate Renewal

Certificates must be renewed before their notAfter date expires. Best practice is to begin the renewal process at least 30 days before expiry (many organizations target 60-90 days). Renewal typically involves generating a new CSR and private key, submitting to the CA, and replacing the old certificate and key on all servers where it is deployed. Let's Encrypt automates this process using the ACME protocol — the certbot tool automatically renews certificates when they have less than 30 days remaining. Expired certificates cause browser errors that stop users from accessing services.

# Automated renewal with Certbot (Let's Encrypt)
# Install certbot and obtain a certificate
certbot --nginx -d example.com -d www.example.com

# Certbot sets up automatic renewal via cron or systemd timer
# Manual renewal test (dry run)
certbot renew --dry-run

# Check when certificates expire
certbot certificates
# Certificate Name: example.com
# Expiry Date: 2026-09-15 (VALID: 87 days)

Why Revoke a Certificate?

Certificate revocation is the process of invalidating a certificate before its scheduled expiry date. Reasons for revocation include: the private key was compromised (most urgent — immediate revocation required), the certificate was issued in error (wrong domain, wrong organization), the subject's information changed (company renamed, employee left), or the CA itself was compromised. Revocation is critical because browsers and systems that don't know a certificate is revoked will continue to trust it — giving an attacker in possession of the stolen private key an active MITM capability until the certificate expires or is known to be revoked.

Certificate Revocation Lists (CRL)

A Certificate Revocation List (CRL) is a signed list published by a CA that contains the serial numbers of all certificates it has revoked that have not yet expired. Clients download the CRL, cache it, and check if a presented certificate's serial number appears on the list. CRLs have significant limitations: they can be very large (large CAs have millions of revoked certificates), clients often cache them for hours or days introducing lag, and downloading the full CRL for every connection is inefficient. CRLs are still used but increasingly complemented or replaced by OCSP.

# Download and view a CRL
# First get the CRL URL from the certificate
openssl x509 -in cert.pem -noout -text | grep -A4 'CRL Distribution'
# URI:http://crl3.digicert.com/DigiCertGlobalRootCA.crl

# Download and decode the CRL
openssl crl -inform DER -in DigiCertGlobalRootCA.crl -noout -text | head -40
# Shows: Revoked Certificates list with serial numbers and revocation dates

OCSP: Online Certificate Status Protocol

OCSP (Online Certificate Status Protocol) provides real-time certificate revocation checking without requiring clients to download entire CRLs. The client sends a query to the CA's OCSP responder with the certificate's serial number. The responder replies with a signed response indicating the certificate is good, revoked (with revocation date and reason), or unknown. OCSP is faster and more timely than CRL, but every TLS connection requires an additional HTTP round-trip to the OCSP responder, adding latency. OCSP responses are signed by the CA to prevent tampering.

# Query OCSP status manually
# Get OCSP URL from certificate
OCSP_URL=$(openssl x509 -in cert.pem -noout -ocsp_uri)
echo $OCSP_URL  # http://ocsp.digicert.com

# Check certificate revocation status via OCSP
openssl ocsp -issuer intermediate_ca.pem \
              -cert cert.pem \
              -url $OCSP_URL \
              -text -noverify
# Response: cert.pem: good

OCSP Stapling: Solving Performance

OCSP Stapling solves the latency problem of real-time OCSP checking. Instead of the client querying the CA's OCSP responder during each TLS handshake, the server pre-fetches its own OCSP response from the CA and 'staples' (attaches) it to the TLS handshake. The client receives a fresh, CA-signed OCSP response directly from the server — no additional round-trip required. The server refreshes its stapled OCSP response periodically (typically every hour). OCSP Stapling improves connection speed and reduces load on CA OCSP responders while maintaining revocation checking.

# Enable OCSP Stapling in nginx
# In your server block:
# ssl_stapling on;
# ssl_stapling_verify on;
# ssl_trusted_certificate /path/to/chain.pem;
# resolver 8.8.8.8 8.8.4.4 valid=300s;

# Verify OCSP Stapling is working
openssl s_client -connect example.com:443 -status 2>/dev/null | \
  grep -A 20 'OCSP Response Status'
# OCSP Response Status: successful (0x0)
# Cert Status: Good

OCSP Must-Staple Extension

OCSP Must-Staple is an X.509 extension that tells browsers the server must provide a stapled OCSP response. Without it, browsers perform a 'soft fail' if the OCSP check fails — they allow the connection anyway (to prevent OCSP responder outages from blocking all TLS). An attacker can exploit soft-fail behavior by blocking the client's OCSP request, making it appear the certificate is still valid even after revocation. OCSP Must-Staple prevents this by requiring a valid stapled response; without it, the browser refuses the connection. Adoption remains limited due to deployment complexity.

Certificate Pinning vs Revocation

Certificate revocation and certificate pinning address the same problem — trusting fraudulent certificates — but from different angles. Revocation (CRL/OCSP) is a reactive mechanism: the CA invalidates a certificate after a problem is discovered. Pinning is a proactive mechanism: the application refuses any certificate except a pre-approved one. Pinning provides stronger guarantees than revocation because it works even if the CA fails to revoke promptly, but introduces deployment rigidity. For the Security+ exam, know both mechanisms and understand that revocation is the standard PKI mechanism while pinning is an optional defense-in-depth measure.

Certificate Pinning vs Revocation Recap

When a certificate is revoked, the CA assigns a revocation reason code that helps clients and administrators understand why. Common reason codes defined in RFC 5280 include: keyCompromise (the private key was compromised), cACompromise (issuing CA was compromised), affiliationChanged (subject's organization changed), superseded (new certificate issued as replacement), cessationOfOperation (domain no longer active), and privilegeWithdrawn (entitlement revoked). The reason code appears in both CRL entries and OCSP responses, providing context for incident response teams investigating revocation events.

Automated Certificate Management: ACME

The ACME (Automatic Certificate Management Environment) protocol, used by Let's Encrypt, automates the entire certificate lifecycle. ACME clients (like certbot) automatically request, renew, and deploy certificates without human intervention. The CA uses domain validation challenges to confirm domain ownership: the HTTP-01 challenge requires placing a specific file at a known URL; the DNS-01 challenge requires creating a DNS TXT record. ACME has transformed certificate management — 90-day certificates from Let's Encrypt now power a large fraction of the internet's HTTPS traffic, all renewed automatically.

# ACME/certbot lifecycle
# Initial certificate issuance (HTTP challenge)
certbot certonly --webroot -w /var/www/html \
  -d example.com -d www.example.com

# Or DNS challenge (for wildcard certs)
certbot certonly --dns-route53 \
  -d '*.example.com' -d example.com

# Automatic renewal via cron (certbot installs this)
# 0 12 * * * root certbot renew --quiet

Quick Check

Test your understanding of CompTIA Security+ (SY0-701) concepts from this lesson.

Lesson Recap

In this lesson you learned: the certificate lifecycle runs from CSR generation through issuance, deployment, and renewal or revocation; CRL provides batch revocation lists while OCSP provides real-time per-certificate status; OCSP Stapling eliminates the latency of real-time OCSP; and ACME (Let's Encrypt) automates the entire renewal lifecycle. Next up we explore PKI Use Cases.

Frequently asked questions

Is the “Certificate Lifecycle and Revocation” lesson free?

Yes — the full text of “Certificate Lifecycle and Revocation” is free to read here on the web, and the Cloud & IT Cert Prep course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cloud & IT Cert Prep course, upgrade to CoddyKit PRO.

What will I learn in “Certificate Lifecycle and Revocation”?

Follow a certificate from issuance through renewal to revocation, and learn how CRL and OCSP communicate revocation status in real time. You practise Cloud & IT Cert Prep with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cloud & IT Cert Prep?

No prior experience is required. Cloud & IT Cert Prep on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Certificate Lifecycle and Revocation” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cloud & IT Cert Prep lesson?

Yes. Every Cloud & IT Cert Prep lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Certificate Authorities and Trust Chains
  2. X.509 Certificate Structure
  3. Certificate Lifecycle and Revocation
  4. PKI Use Cases: HTTPS, S/MIME, and Code Signing
← Back to Cloud & IT Cert Prep