PKI & Certificates

Public Key Infrastructure, digital certificates, and certificate authorities.

The Digital Identity Crisis: A Problem of Trust

In the physical world, verifying identity is a relatively straightforward process. When you go to a bank to open an account, the teller asks to see a form of government-issued identification, like a driver's license or passport. You present the document, and the teller trusts it for several reasons: it has official seals, holograms, a photo that matches your face, and, most importantly, it was issued by a highly trusted entity: the government. The bank trusts the government, and therefore, it trusts the ID that the government has issued to you.

The internet, however, has a massive identity crisis. When your browser connects to a website claiming to be 'amazon.com', how does it really know? There are no faces to match or physical documents to inspect. An attacker could easily create a fraudulent website that looks identical to the real one and intercept your connection, a technique known as a man-in-the-middle attack. If you were to enter your password and credit card number on this fake site, you would be handing your most sensitive information directly to a criminal. To make secure online interactions possible, we need a global, scalable system for verifying digital identities: a digital equivalent of the entire passport and ID issuance system. This system is known as Public Key Infrastructure.

What is Public Key Infrastructure (PKI)?

is not a single piece of technology but a comprehensive framework: a combination of policies, standards, hardware, and software, that provides the foundation for digital trust on the internet. Its primary purpose is to securely bind public keys to specific entities, such as people, organizations, or servers.

If we continue our passport analogy, PKI is not just the passport itself. It is the entire ecosystem that makes the passport trustworthy: the laws that define what an identity is, the government agencies that issue passports, the secure printing facilities, the procedures for verifying a person's identity before issuing a passport, and the systems for reporting a passport as lost or stolen. In the same way, PKI provides all the necessary components to issue, manage, distribute, and revoke digital identity documents, which are called digital certificates.

The Core Components of the PKI Ecosystem

The PKI framework is composed of several key actors and components that work together to establish and maintain trust.

  1. Certificate Authority (CA): The Digital Passport Office.

    The is the cornerstone of the entire PKI system. A CA is a highly trusted organization responsible for issuing digital certificates. Its job is to rigorously verify the identity of an individual or organization requesting a certificate. Once it is confident of their identity, it uses its own highly protected private key to create a digital signature on the applicant's certificate. This signature is the CA's official stamp of approval, vouching for the fact that the public key contained within the certificate genuinely belongs to the entity named in the certificate. Well-known public CAs include DigiCert, GlobalSign, and Let's Encrypt.

  2. Registration Authority (RA): The Local Application Agent.

    In large-scale PKI deployments, the CA may delegate the task of identity verification to a separate entity known as a Registration Authority (RA). The RA acts as the frontline agent. It accepts certificate requests, performs the initial identity checks according to the CA's policies, and then forwards the validated request to the CA for the final certificate issuance. This is similar to using a licensed passport application acceptance facility to verify your documents before they are sent to the central government printing office.

  3. Digital Certificates: The Digital ID Card.

    A digital certificate is the electronic document at the heart of PKI. It is a standardized data structure, most commonly defined by the X.509 standard, that contains key information binding an entity's identity to its public key. We will explore its structure in detail later.

  4. Certificate Revocation Mechanisms (CRL & OCSP): The Lost or Stolen List.

    What happens if a private key associated with a certificate is stolen, or an organization ceases to exist? The certificate must be invalidated before its official expiry date. This process is called revocation. PKI includes mechanisms to publicize which certificates are no longer trustworthy, similar to a list of canceled credit cards or stolen passports. The two primary mechanisms are the Certificate Revocation List (CRL) and the Online Certificate Status Protocol (OCSP).

  5. Certificate Repository: The Public Directory.

    This is a publicly accessible directory or database where a CA publishes the certificates it has issued and its latest CRLs. This allows anyone to retrieve a certificate and check its validity and status.

Anatomy of a Digital Certificate (X.509)

Just as a passport contains specific fields of information, a standard X.509 digital certificate has a defined structure containing several key pieces of data.

  • Version: Indicates which version of the X.509 standard the certificate adheres to (usually version 3).
  • Serial Number: A unique positive integer assigned by the CA that unambiguously identifies this specific certificate from all others issued by that CA.
  • Signature Algorithm: The algorithm that the CA used to sign this certificate (e.g., SHA-256 with RSA).
  • Issuer: The identity of the Certificate Authority that verified the information and issued this certificate.
  • Validity Period: The start and end dates for which the certificate is considered valid (the "Valid From" and "Valid To" dates).
  • Subject: The identity of the person, organization, or device to whom the certificate belongs. For a website's SSL/TLS certificate, this field must contain the domain name of the website (e.g., 'Common Name = www.google.com').
  • Subject's Public Key Information: This field contains the actual public key of the subject, along with the algorithm with which the key is used (e.g., RSA or ECC).
  • Issuer's Digital Signature: This is the most crucial part for establishing trust. The CA creates this signature by first calculating a cryptographic hash (a unique digital fingerprint) of all the other certificate information, and then encrypting that hash with its own highly-guarded private key. This signature can only be decrypted and verified using the CA's public key.

The Chain of Trust: How Verification Actually Works

The genius of PKI lies in the concept of a "chain of trust." A user's browser does not need to know and trust every single CA in the world. Instead, operating systems and browsers come pre-installed with a small list of highly trusted, top-level CAs known as Root CAs. This forms the basis of all trust.

Here is the step-by-step verification process when you visit a secure website:

  1. Presentation: Your browser connects to 'https://www.example.com', and the server presents its SSL/TLS certificate. Let's call this the "End-Entity Certificate."
  2. First Check: The browser examines the "Issuer" field of the End-Entity Certificate. It says, for instance, "Example Intermediate CA".
  3. Walking the Chain: The browser checks its list of trusted Root CAs. "Example Intermediate CA" is not on that list. However, along with its own certificate, the web server also presents the certificate of "Example Intermediate CA". The browser examines this second certificate.
  4. Second Check: The browser looks at the "Issuer" field of the "Example Intermediate CA" certificate. This one says it was issued by "Example Root CA". The browser also verifies the signature on the End-Entity Certificate using the public key from the Intermediate CA's certificate.
  5. The Trust Anchor: The browser checks its list of trusted Root CAs again. This time, it finds "Example Root CA" on the list! It knows it can implicitly trust this Root CA. It then uses the public key from the trusted Root CA certificate (which it already has) to verify the digital signature on the Intermediate CA's certificate.
  6. Trust Established: Because the signature on the Intermediate CA certificate is valid and was made by a trusted Root CA, the browser now trusts the Intermediate CA. And because it now trusts the Intermediate CA, it can trust the signature it made on the 'www.example.com' certificate. The chain of trust is complete, and the browser displays the padlock icon.

This hierarchical structure, from the Root CA down through one or more Intermediate CAs to the End-Entity, allows the system to scale globally while maintaining a small, manageable set of ultimate trust anchors.

Revocation: Invalidating a Compromised Certificate

What if the private key for 'www.example.com' is stolen? The certificate needs to be immediately invalidated, or else attackers could use it to impersonate the site. PKI has two primary mechanisms for this.

Certificate Revocation List (CRL)

A CRL is simply a list, published and digitally signed by a CA, that contains the serial numbers of all the certificates it has issued that have been revoked before their expiration date. To check a certificate's status, a browser would have to download the latest CRL from the CA.

Drawbacks: CRLs can become very large and slow to download. Furthermore, they are only updated periodically (e.g., every 24 hours), meaning a certificate could be compromised and used maliciously for several hours before it appears on the next CRL.

Online Certificate Status Protocol (OCSP)

was designed to solve the timeliness issue of CRLs. Instead of downloading a huge list, the browser can send a small, real-time query to an OCSP server (a responder) run by the CA. The query simply asks, "Is the certificate with serial number '12345ABCD' still valid?" The OCSP responder sends back a small, digitally signed response indicating the status as 'good', 'revoked', or 'unknown'.

OCSP Stapling: A potential privacy and performance issue with OCSP is that the user's browser sends a query to the CA for every site visited, revealing browsing habits. To solve this, a technique called OCSP Stapling was developed. The web server itself periodically queries the OCSP responder for its own certificate's status. It then receives a signed, timestamped OCSP response, which it "staples" onto the certificate it presents to browsers during the TLS handshake. This way, the browser gets timely revocation information directly from the server without having to make a separate, privacy-leaking query to the CA.

Levels of Trust: Types of SSL/TLS Certificates

Not all certificates provide the same level of identity assurance. The rigor of the identity verification process performed by the CA before issuing a certificate determines its type. There are three main validation levels:

  • Domain Validated (DV): This is the most basic level of validation. The CA only verifies that the applicant controls the domain name for which they are requesting the certificate. This is usually done by responding to an automated email sent to an address at that domain or by placing a specific file on the website. It provides encryption but makes no claim about the legal identity of the website's operator. Let's Encrypt is a famous provider of free DV certificates.
  • Organization Validated (OV): This involves a more thorough vetting process. The CA requires the applicant to provide documentation proving the legal existence and physical location of their organization. The organization's name is included in the certificate, providing a higher level of assurance to visitors.
  • Extended Validation (EV): This is the highest level of trust. The CA performs an extremely rigorous vetting process, following strict industry guidelines. This involves verifying legal, operational, and physical existence, as well as confirming that the applicant has the exclusive right to use the domain. Historically, browsers displayed the organization's name in a prominent green bar for EV certificates, though most modern browsers have moved away from this special UI treatment.

In summary, PKI and digital certificates form the silent, unseen bedrock of digital trust. This complex, global infrastructure of rules and technology is what allows us to confidently and securely conduct our lives and businesses online, transforming the open, public square of the internet into a world of private, trustworthy conversations.

    PKI & Certificates | Teleinf Edu