Next, you'll need
EasyPG installed, that comes with Emacs these
days. EasyPG is a beast of its own, but it does come with quite a
few handy mail functions.
While composing an email, enter
M-x epa-mail-sign to sign the
message with your PGP key.
epa-mail-sign parses your mail
buffer, so you don't need to select parts of the text, etc.
Call with a prefix argument to select which key to use for signing.
Just like with signing, simply run the command in a mail message
buffer, this time
M-x epa-mail-encrypt. This time, it will use
the recipient list to perform the encryption, which is really
Again, use a prefix argument to select another key to use for
encrypting the message. I'm not sure how useful this is in a
real-world scenario, as
epa-mail-encrypt reads the sender
identity from the mail message.
When you receive a signed email, use
M-x epa-mail-verify to
verify the signature.
When receiving an encrypted email, use
M-x epa-mail-decrypt to
To import any PGP armor keys in the current message buffer, enter
M-x epa-mail-import-keys to add them to your keychain.
EasyPG ships with a minor mode for use in mail programs, which is really useful.
epa-mail-mode when composing messages:
(add-hook 'mu4e-compose-mode-hook (defun my-setup-epa-hook () (epa-mail-mode)))
Now, when composing a message, use:
C-c C-e sto sign a message.
C-c C-e eto encrypt a message
Let's enable it in
mu4e-view-mode as well:
(add-hook 'mu4e-view-mode-hook (defun my-view-mode-hook () (epa-mail-mode)))
Now, when viewing a message, enter:
C-c C-e vto verify a signature
C-c C-e dto decrypt a message