HTTPS (HyperText Transfer Protocol Secure) is a protocol for encrypting information and then exchanging it in a secure way.
With HTTPS if anyone in between the sender and the recipient could open the message, they still could not understand it. Only the sender and the recipient, who know the “code,” can decipher the message.
The computer at each end uses a document called an “SSL Certificate” containing character strings that are the keys to their secret “codes.” SSL certificates contain the computer owner’s “public key.”
The owner shares the public key with anyone who needs it. Other users need the public key to encrypt messages to the owner. The owner sends those users the SSL certificate, which contains the public key. The owner does not share the private key with anyone.