$ gpg --import someone-else.pub_key
$ gpg --encrypt --sign --armor --recipient [email protected] clear_message.txt
--sign: sign the file with your details
--armor: create an ASCII output
--recipient: email address (or ID) of the person you’re sending the message to
$ gpg --encrypt --sign --armor --local-user "[email protected]" --recipient [email protected] clear_message.txt
--local-user: specify user ID (or) user fingerprint to sign the message. If this option is not used, the default key will be used.
$ gpg --decrypt encrypted_message.txt