Blame | Last modification | View Log | RSS feed
Introduction to PKI===================This document is designed to give you a brief introduction into how a PKI, orPublic Key Infrastructure, works.Terminology Used----------------To avoid confusion, the following terms will be used throughout the Easy-RSAdocumentation. Short forms may be substituted for longer forms as convenient.* **PKI**: Public Key Infrastructure. This describes the collection of filesand associations between the CA, keypairs, requests, and certificates.* **CA**: Certificate Authority. This is the "master cert" at the root of aPKI.* **cert**: Certificate. A certificate is a request that has been signed by aCA. The certificate contains the public key, some details describing thecert itself, and a digital signature from the CA.* **request**: Certificate Request (optionally 'req'.) This is a request for acertificate that is then send to a CA for signing. A request contains thedesired cert information along with a digital signature from the privatekey.* **keypair**: A keypair is an asymmetric cryptographic pair of keys. Thesekeys are split into two parts: the public and private keys. The public keyis included in a request and certificate.The CA------The heart of a PKI is the CA, or Certificate Authority, and this is also themost security-sensitive. The CA private key is used to sign all issuedcertificates, so its security is critical in keeping the entire PKI safe. Forthis reason, it is highly recommended that the CA PKI structure be kept on asystem dedicated for such secure usage; it is not a great idea to keep the CAPKI mixed in with one used to generate end-entity certificates, such as clientsor servers (VPN or web servers.)To start a new PKI, the CA is first created on the secure environment.Depending on security needs, this could be managed under a locked down account,dedicated system, or even a completely offline system or using removable mediato improve security (after all, you can't suffer an online break-in if yoursystem or PKI is not online.) The exact steps to create a CA are described in aseparate section. When creating a new CA, the CA keypair (private and publickeys) are created, as well as the file structure necessary to support signingissued certificates.Once a CA has been created, it can receive certificate requests fromend-entities. These entity certificates are issued to consumers of X509certificates, such as a client or server of a VPN, web, or email system. Thecertificate requests and certificates are not security-sensitive, and can betransferred in whatever means convenient, such as email, flash drive, etc. Forbetter security, it is a good idea to verify the received request matches thesender's copy, such as by verifying the expected checksum against the sender'soriginal.Keypairs and requests---------------------Individual end-entities do not need a full CA set up and will only need tocreate a keypair and associated certificate request. The private key is not usedanywhere except on this entity, and should never leave that system. It is wiseto secure this private key with a strong passphrase, because if lost or stolenthe holder of the private key can make connections appearing as the certificateholder.Once a keypair is generated, the certificate request is created and digitallysigned using the private key. This request will be sent to a CA for signing, anda signed certificate will be returned.How requests become certificates--------------------------------After a CA signs the certificate request, a signed certificate is produced. Inthis step, the CA's private key is used to digitally sign the entity's publickey so that any system trusting the CA certificate can implicitly trust thenewly issued certificate. This signed certificate is then sent back to therequesting entity. The issued certificate is not security-sensitive and can besent over plaintext transmission methods.Verifying an issued certificate-------------------------------After 2 entities have created keypairs, sent their requests to the CA, andreceived a copy of their signed certificates and the CA's own certificate, theycan mutually authenticate with one-another. This process does not require the 2entities to have previously exchanged any kind of security information directly.During a TLS handshake each side of the connection presents their own cert chainto the remote end. Each side checks the validity of the cert received againsttheir own copy of the CA cert. By trusting the CA root cert, the peer they aretalking to can be authenticated.The remote end proves it "really is" the entity identified by the cert bysigning a bit of data using its own private key. Only the holder of the privatekey is able to do this, allowing the remote end to verify the authenticity ofthe system being connected to.