Public Key Encryption scheme is a cryptographic construct that makes possible (among others) creating the above mentioned certificates. The PKE is further combined with a set of procedures, agencies, software and hardware to constitute a Public Key Infrastructure.
These are fundamental concepts for PKE:
PKE is an asymmetric key encryption scheme, meaning that different key (from the public-secret pair) is used for encryption and for decryption.
Using fundamental concepts of PKE one can perform the following operations.
Encryption
Suppose a user (typically called Alice) wants to communicate with another (Bob) sending an encrypted message. Let \(M\) be the plaintext message and \(pk_B\) be Bob's public key (as such it is known to Alice). Alice can then encrypt \(M\) like so: \[ C = Enc_{pk_B}(M), \] and send \(C\) to Bob. Recall that by design it is not possible to learn \(M\) from \(C\) without knowing Bob's decryption key, which happens to be his secret key, \(sk_B\). Bob computes: \[ M = Dec_{sk_B}(C) \] thus retrieving message.
Signing
Conversly, suppose that Alice wants to send a message \(M\) to Bob, but now the condition is that Bob must be sure that what he gets is the message from Alice. She calculates, using her secret key: \[ \sigma = Enc_{sk_A}(M), \] and sends \(\sigma\) to Bob. On receipt, Bob uses Alice's public key and calculates: \[ M = Dec_{pk_A}(\sigma). \] Since the pair \(pk_A\) and \(sk_A\) are chosen so, only applying \(pk_A\) to \(\sigma\) yields \(M\), so Bob can be sure that \(\sigma\) was created using \(sk_A\), which in turn must be only in posession of Alice's.
There are different implementations of encryption and signing schemes and some
will be discussed later. For now let \(\sigma = Sign(sk, M)\) and
\(Verify(pk, \sigma, M)\) be signing and signature verification algorithms under
PKE pair of keys (\(pk, sk\)), public and secret, respectively.
Certificate issuing and use
Define a certificate \(CE\) to be a tuple: \((id, P, \sigma_{CA})\), where \(id\) is an identifier of the certificate owner, \(P\) is some set of properties of the owner, among which is the owner's public key, and \(\sigma_{CA}\) is the signature of Certificate Authority (CA) under \(id,P\). The CA is a publically trusted centre that is a recognised organization responsible for issuing certificates (or an organization that obtained right to issue certificates from some other CA). The public keys of all CA's are widely known and published so that each user of the Internet has access to them.
Suppose Alice has the following certificate: \(CE = (Alice, pk_A, \sigma_{CA})\). When Bob wants to make sure that only Alice will be able to understand their communication, he proceeds as follows:
Observe, that even if Charles took place of Alice, then in step 1. above, Charles could send only Alice's CE (he might have overheard it some time ago), and Bob would verify its validity. However, using in step 3. \(pk_A\) (obtained from the certificate) with communication with Charles would still keep the communication secure - Charles doesn't know Alices secret key and thus cannot decrypt Bob's message.
To make possible such use of certificates the whole infrastructure must be maintained. Among others:
Notably, there are alternatives to PKI such as Web of Trust or Simple PKI.