This post talks about the basic requirements to implement Transport Layer Security (TLS) and problems it solves
End-to-End encryption
How are you sure that nobody is reading or changing what you send?
This issue is solved by using Public-Key cryptography
How does it work?
It consists in a pair of keys, public key and private key
first, public key is used to encrypt messages
then, private key is used to decrypt messages
Trust Connection
How are you sure that there isn't another machine impersonating the host that you are trying to connect?
This issue is solved by using Public-key certificate also known as Digital Certificate or just Certificate
What is the Certificate?
The Certificate is basically a digital form of identification, where the public key is typically published with attached information, including the issuer.
Certificates are created by a Certificate Authority (CA), a mutually trusted third party that confirms the identity of the certificate requestor. For instance, VeriSign and GoDaddy are two of the most populars
How does it work?
Instead of asking for the Public key of the remote host, it would ask for its Certificate
In order to accept the remote connection, the CA certificate should be known
File Formats
.pem
Is a plain-text format that could contain the certificate and/or the private key and/or public key
You can open .pem files in any text editor and check