Skip to content
cybersecurity pki

X.509 Certificate

x509 certificate tls pki public-key cryptography
Plain English

An X.509 certificate is a standardized digital document that says three things: here is a public key, here is who it belongs to, and here is a trusted authority’s signature proving that association is real. It also says when it expires. When your browser connects to a website over HTTPS, the server presents its X.509 certificate. Your browser checks that a CA it trusts signed it, that the domain name matches, and that the certificate has not expired. If all three pass, you get the padlock. The same mechanism works for SSH with hardware tokens, VPN certificates, and email signing.

Technical Definition

X.509 is an ITU-T standard (part of X.500 directory services) that defines the structure of public key certificates. Version 3 is universally used today.

Certificate structure (TBSCertificate):

FieldDescriptionExample
VersionCertificate version (v3 = 2)2
Serial NumberUnique number from issuing CA0x3a5f…
Signature AlgorithmAlgorithm CA used to signecdsa-with-SHA256
IssuerDistinguished Name of CACN=HomeLab CA
ValiditynotBefore / notAfter2026-01-01 / 2027-01-01
SubjectDN of certificate holderCN=George McClain,O=HomeLab
Public KeyAlgorithm and key bytesEC P-256 public key
Extensionsv3 extensionsKey usage, SAN, AKI, SKI

Key v3 Extensions:

  • Subject Alternative Name (SAN): Additional identities (DNS names, IPs, email addresses). Browsers require this; CN alone is deprecated for domain validation.
  • Key Usage: Constrains cryptographic operations (digitalSignature, keyEncipherment, etc.)
  • Extended Key Usage (EKU): Application-level constraints (serverAuth, clientAuth, codeSigning)
  • Authority Key Identifier (AKI): Identifies the CA key that signed this cert (used to build the chain)
  • Subject Key Identifier (SKI): Hash of the subject’s public key
  • Basic Constraints: isCA: true/false, pathLenConstraint for CAs

Encoding formats:

  • DER: Binary encoding (ASN.1). Used by Java, Windows, hardware tokens.
  • PEM: Base64-encoded DER with -----BEGIN CERTIFICATE----- headers. Used everywhere else.
  • PKCS#12 / PFX: Container format bundling cert + private key + CA chain, protected by password.

Inspecting a certificate:

# From a file
step certificate inspect cert.pem

# From a YubiKey PIV slot
ykman piv certificates export 9a - | step certificate inspect

# From a live TLS connection
echo | openssl s_client -connect example.com:443 2>/dev/null | openssl x509 -noout -text

Certificate fingerprint:

A SHA-256 hash of the DER-encoded certificate. Used to uniquely identify a certificate without transmitting it in full. The fingerprint displayed by step ca init for the Root CA is how clients bootstrap trust.

Inspecting a certificate with step

# Export the certificate from YubiKey slot 9a and inspect it
ykman piv certificates export 9a - | step certificate inspect

# Output shows:
# Subject: CN=George McClain,O=HomeLab
# Issuer: CN=HomeLab CA Intermediate
# Validity:
#   Not Before: 2026-01-01T00:00:00Z
#   Not After: 2027-01-01T00:00:00Z
# Key Usage: Digital Signature
# Extended Key Usage: Client Authentication
# Subject Alternative Name: email:george@homelab.local
In the Wild

X.509 certificates are everywhere in modern IT infrastructure: every HTTPS website, every email client that supports S/MIME, every VPN connection using certificate auth, every code signing pipeline, and every hardware token-based login. Understanding what is inside a certificate - and being able to read one with step certificate inspect or openssl x509 -text - is a fundamental skill for anyone working in networking, security, or systems administration. Common real-world problems that trace back to X.509: expired certificates causing service outages (Let’s Encrypt requires 90-day renewal), SAN mismatch errors (the cert was issued for the wrong hostname), and revocation check failures (the CA’s OCSP responder is unreachable). For homelab PIV auth, each YubiKey slot holds one X.509 certificate, and that certificate is what SSH servers and macOS login use to verify your identity.