The public key is a cryptographic key which is used to encrypt a message. Unlike a private key, which is kept entirely secret, a public key is known to everyone.

If someone wants to send a secure to another person, then the sender needs to encrypt the message with the public key of the receiver. The receiver uses the private key to decrypt the message.