Asymmetric cryptography and key pairs
PKI is built on asymmetric cryptography, where every participant has two mathematically linked keys: a public key that anyone can have and a private key that only the owner possesses. What one key encrypts, only the other can decrypt. This relationship is one-way: knowing the public key tells you nothing useful about the private key.
When you encrypt data with someone's public key, only their private key can decrypt it. This gives you confidentiality because only the intended recipient can read the message. When someone encrypts data with their own private key, anyone with the public key can decrypt it and verify that only the private key owner could have produced it. This is how digital signatures work.
The problem PKI solves is: how do you know that a public key actually belongs to who you think it does? Without a system of trust, an attacker could substitute their own public key and intercept communications. Certificate Authorities solve this problem.
Certificate Authorities and the chain of trust
A Certificate Authority (CA) is a trusted third party that binds a public key to an identity by issuing a digital certificate. The CA verifies that the entity requesting a certificate actually controls the domain or identity they claim, then signs the certificate with the CA's own private key. When your browser receives a certificate, it verifies the CA's signature using the CA's public key, which is pre-installed in the browser's trusted root store.
The chain of trust usually has three levels: a Root CA at the top (offline, highly protected), one or more Intermediate CAs in the middle (issue certificates on behalf of the Root), and end-entity certificates at the bottom (the certificates websites and users actually use). Root CAs sign intermediate certificates. Intermediate CAs sign end-entity certificates. Your browser trusts the whole chain as long as it can trace back to a trusted root.
An X.509 certificate contains: the subject's distinguished name (who the certificate belongs to), the subject's public key, the issuing CA's name, validity dates (not before, not after), and the CA's digital signature over all of this. The signature is what prevents tampering. If any field changes, the signature becomes invalid.
Certificate revocation and how to choose the correct answer
Certificates expire, but sometimes they need to be invalidated before expiry. A private key compromise is the most serious reason: if an attacker has a copy of your private key, your certificate cannot be trusted even if it is technically still valid. Revocation is also used when an employee leaves and their certificate should no longer be trusted.
CRL (Certificate Revocation List): a periodically published list of revoked certificate serial numbers, signed by the CA. Browsers download the CRL and check whether the certificate's serial number appears. CRLs can be large and may be outdated by hours or days depending on publishing frequency.
OCSP (Online Certificate Status Protocol): real-time protocol where a browser sends a specific certificate's serial number to an OCSP responder and gets a signed response: good, revoked, or unknown. Faster and more current than CRL. OCSP Stapling attaches a cached, signed OCSP response to the TLS handshake, eliminating the extra round-trip to the OCSP server.
Choosing correct answers: verifying a certificate = checking signature chain and validity. Revoking before expiry = CRL or OCSP. Real-time revocation check = OCSP. Offline periodic check = CRL. Digital signature provides integrity and non-repudiation. Encrypting with public key provides confidentiality.