Public Key Infrastructure ยท 4.2

๐Ÿ“„ Digital Certificates & X.509

The digital equivalent of a government-issued IDโฑ ~2 min

A digital certificate is a signed data structure that binds a public key to an identity. The X.509 standard (defined by the ITU-T and used universally in TLS, email, and code signing) specifies what a certificate contains.

What's Inside an X.509 Certificate

FieldWhat It ContainsExample
SubjectWho this certificate identifiesCN=example.com, O=Example Inc, C=US
Public KeyThe entity's public keyRSA 2048-bit or ECC P-256 public key
IssuerWhich CA signed this certificateCN=DigiCert TLS RSA SHA256 2020 CA1
Validity PeriodNot Before / Not After dates2024-01-01 to 2025-01-01
Subject Alternative NamesAll domains this cert is valid forDNS:example.com, DNS:www.example.com
Key UsageWhat operations the key is allowed forDigital Signature, Key Encipherment
CA SignatureThe CA's digital signature over all the aboveSHA-256 with RSA/ECDSA

Certificate Types

TypeValidation LevelWhat's VerifiedUse
DV (Domain Validated)LowApplicant controls the domain (automated)General websites โ€” cheapest, instant
OV (Organization Validated)MediumDomain + legal existence of organizationBusiness sites โ€” shows company name
EV (Extended Validation)HighDomain + legal entity + physical locationFinancial, healthcare โ€” green bar (legacy)
WildcardVariesAll subdomains (*.example.com)Multi-subdomain deployments
Code SigningMedium/HighIdentity of software publisherSigning executables, installers

Certificate Formats

bash
# View a certificate's contents
openssl x509 -in certificate.pem -text -noout
# Download and inspect a website's certificate
openssl s_client -connect google.com:443 -showcerts
# Check certificate expiry
echo | openssl s_client -connect example.com:443 2>/dev/null | openssl x509 -noout -dates
# Common certificate file formats:
# .pem โ€” base64 encoded, -----BEGIN CERTIFICATE----- header
# .der โ€” binary encoding of the same structure
# .pfx/.p12 โ€” PKCS#12: certificate + private key bundled (password-protected)
# .crt/.cer โ€” usually PEM format, different file extension
๐Ÿ’ก TipClick the padlock icon in your browser's address bar to inspect a website's certificate. You'll see the issuer, subject, validity dates, and the full certificate chain. This is also where you'd detect a certificate that looks wrong or is issued by an unexpected CA.
๐Ÿง Quick Checkfirst try = +5 XP

What binds a public key to a domain name?

โญ 0 XP๐Ÿ”ฅ 0 days