top of page

Security+: Given a Scenario, Implement Public Key Infrastructure

  • Writer: Tony Stiles
    Tony Stiles
  • Jun 20, 2024
  • 5 min read

Given a Scenario, Implement Public Key Infrastructure



Public Key Infrastructure (PKI)

Public key infrastructure (PKI) is a system of hardware, software, policies, and procedures used to create, manage, distribute, and revoke digital certificates and their associated public and private keys. A digital certificate is an electronic document that associates a public key with the identity of an individual, organization, or device. PKI provides a framework for secure electronic communication by enabling entities to establish and verify identities and establish secure communication channels.


PKI is used for a variety of purposes, including:

  • Secure email communication

  • Secure web communication, including website authentication and secure socket layer (SSL) encryption

  • Virtual private network (VPN) access

  • Wireless network access

  • Secure file transfer

  • Digital signatures and document encryption

  • Secure access to cloud services and applications


Some elements involved in PKI are:

  • Key management: The process of creating, storing, distributing, and revoking cryptographic keys that are used for authentication, encryption, and digital signatures.

  • Certificate authority (CA): A trusted entity that issues digital certificates to verify the identity of an individual or organization. The CA also maintains a repository of issued certificates and their corresponding public keys.

  • Intermediate CA: A subordinate CA that is authorized by the root CA to issue digital certificates on its behalf.

  • Registration authority (RA): An entity that verifies the identity of the certificate requester before submitting a certificate request to the CA for issuance.

  • Certificate revocation list (CRL): A list of digital certificates that have been revoked or are no longer valid before their expiration date.

  • Certificate attributes: Additional information that is associated with a digital certificate, such as the name and email address of the certificate holder, the purpose of the certificate, and the name of the CA that issued the certificate.

  • Online Certificate Status Protocol (OCSP): A protocol that enables real-time verification of the validity of a digital certificate.

  • Certificate signing request (CSR): A request that is sent to a CA to obtain a digital certificate. The CSR includes the public key of the requester and the desired attributes of the certificate.

  • CN: The common name attribute of a digital certificate that identifies the name of the entity associated with the certificate.

  • Subject alternative name: An attribute of a digital certificate that allows for the specification of additional subject names to be associated with the certificate.

  • Expiration: The date and time at which a digital certificate becomes invalid and can no longer be used for authentication, encryption, or digital signatures.


Types of Certificates

A PKI certificate is a digital certificate issued by a certificate authority (CA) to validate the identity of a person, organization, or device. It is used to establish secure communications over a network and to verify the authenticity of digital data.


  • Wildcard: A wildcard certificate is a type of PKI certificate that allows a single certificate to secure multiple subdomains of a domain.

  • Subject alternative name: Subject alternative name (SAN) is an extension to a PKI certificate that allows additional identities (such as domain names, IP addresses, email addresses, etc.) to be bound to the same certificate.

  • Code signing: Code signing certificates are PKI certificates used to sign executable code to ensure its authenticity and integrity.

  • Self-signed: A self-signed certificate is a PKI certificate where the digital signature is created and validated by the same entity, without involving a trusted third-party CA.

  • Machine/computer: A machine or computer certificate is a PKI certificate issued to a device such as a computer, server, or IoT device to authenticate its identity for secure communication with other devices or services.

  • Email: An email certificate is a type of PKI certificate used for secure email communication, where the certificate is bound to an email address and is used to encrypt and digitally sign email messages.

  • User: A user certificate is a type of PKI certificate issued to an individual user to authenticate their identity for secure access to network resources.

  • Root: A root certificate is a type of PKI certificate that is self-signed and used to establish the trust relationship between a CA and the PKI certificates it issues.

  • Domain validation: A domain validation certificate is a type of PKI certificate that verifies only the domain ownership of the certificate applicant, rather than their identity.

  • Extended validation: An extended validation certificate is a type of PKI certificate that requires a more rigorous validation process to verify the identity of the certificate applicant. It is commonly used for e-commerce websites and is indicated by a green address bar in most web browsers.


Certificate Formats

The following are PKI certificate formats:

  1. Distinguished Encoding Rules (DER): A binary format used to encode and decode PKI certificates and certificate requests.

  2. Privacy Enhanced Mail (PEM): A base64-encoded ASCII format used to represent a certificate, certificate chain, or private key.

  3. Personal Information Exchange (PFX): A binary format that is used to store a certificate, its private key, and any associated intermediate certificates in a single encrypted file.

  4. .cer: A standard format for X.509 digital certificates that contain only the public key and do not include any private key information.

  5. P12: A file extension for PKCS #12 files that contain both the certificate and the private key.

  6. P7B: A file format that is used to store X.509 digital certificates in a binary format, often used for intermediate and root certificates.


Concepts

  • Online vs. offline CA: A Certificate Authority (CA) can operate in an online or offline mode. An online CA is always connected to the network and can issue, renew, and revoke certificates immediately, whereas an offline CA is not connected to the network, and the issuing of certificates is a manual process that involves physically transporting the certificate request to the CA.

  • Stapling: Stapling is a method used by a web server to send a digitally signed certificate status message (OCSP response) during the SSL/TLS handshake. This enables the web server to prove the validity of its certificate without the need for the client to make an additional request to the CA.

  • Pinning: Pinning is a technique used to ensure that a client only accepts a specific certificate or public key, and it can help prevent man-in-the-middle attacks. Pinning can be implemented in a web browser or application, and it involves storing the public key or certificate of a specific website or server.

  • Trust model: A trust model is a set of rules or procedures used to establish and verify trust relationships between entities in a PKI environment. In a PKI, a trust model determines how certificates are issued, how they are validated, and how trust is established between the entities in the PKI.

  • Key escrow: Key escrow is the process of storing a copy of an encryption key with a trusted third party. This is typically done for backup and recovery purposes, but it can also be used by law enforcement agencies to gain access to encrypted data in certain situations.

  • Certificate chaining: Certificate chaining refers to the process of validating a certificate by verifying the entire chain of certificates that lead up to a trusted root CA. Each certificate in the chain is verified, and if any of the certificates are invalid or have been revoked, the entire chain is considered invalid. The goal of certificate chaining is to establish a trust relationship between the client and the server by verifying that the server's certificate is signed by a trusted root CA.

bottom of page