If a sender and receiver know and trust each other, they can simply exchange public keys and establish secure data transmission, including authentication and encryption. To do this, they would use each other's public keys and their own private keys.
Under normal circumstances, however, parties needing secure data transmissions have no foundation for trusting the identity of each other. Each needs a third party, whom they both trust, to provide proof of their identity.
A party needing to prove its identity in a public key cryptography environment enlists the services of a trusted third party known as a certificate authority.
The primary purpose of the certificate authority is to verify that a party is who or what it claims to be, and then to issue a public key certificate for that party to use. The public key certificate verifies that the public key contained in the certificate belongs to the party named in the certificate.
Once the identity of the requesting party has been established to the satisfaction of the certificate authority, the certificate authority's issues an electronic "certificate" and applies its digital signature.
Just as a personal signature applied to a paper document indicates the authenticity of the document, a digital signature indicates the authenticity of electronic data.
To create a digital signature, the software used to create the signature links the data being signed with the private key of the signer. The following illustration shows the process that a CA follows to create its digital signature for a public key certificate.
A digital signature is uniquely linked to the signer and the data. No one else can duplicate the signature because no one else has the signer's private key. In addition, the signer cannot deny having signed the data. This is known as non-repudiation.
When a certificate authority signs a public key certificate, it guarantees that it has verified the identify of the public key owner according to the certificate authority's established and published policies.
After signed data (such as a public key certificate) is received, software verifies data authenticity by applying the same computation to the data that the signing software used originally. If the data is unaltered, both computations will produce identical results. It can then be safely assumed that neither the data nor the signature was modified in transit.
A certificate chain is an ordered list of certificates. The certificates are ordered such that the server or user certificate is first, followed by the certificate of its CA.
CAs can either sign their own certificates (i.e., they are self-signed) or they can be signed by another Certificate Authority. If they are self-signed, they are typically called Root CAs. If they are not self-signed, they are typically called subordinate CAs or intermediate CAs.
If a user or server certificate was signed by a CA with a self-signed certificate, the certificate chain is composed of exactly two certificates: the end entity certificate and the root CA.
If a user or server certificate was signed by an intermediate CA, then the certificate chain will be longer. The first two elements would still be the end entity certificate, followed by the certificate of the intermediate CA. But, the intermediate CA's certificate would then be followed by the certificate of its CA. This listing would then continue until the last certificate in the list was for a root CA. Thus, a certificate chain can be infinitely long. In practicality, most certificate chains have only two or three certificates, though.
In order to validate a digital signature, you must trust at least one of the certificates in the user or server's certificate chain. You can directly trust the certificate of the user or server, or you can choose to trust any other certificate in the chain. Typically, the certificate that is trusted is the root CA's certificate.
Most application software that can use certificates already has a list of trusted certificates installed. These certificates are for root CAs and, hence, are called "trusted roots." Typically these CAs are commercial CAs. If you choose, you can add additional CAs to this list or remove CAs from the list.