EasyPG Assistant is an Emacs user interface to GNU Privacy Guard (GnuPG, see Top).
EasyPG Assistant is a part of the package called EasyPG, an all-in-one GnuPG interface for Emacs. EasyPG also contains the library interface called EasyPG Library.
This file describes EasyPG Assistant 1.0.0.
Copyright © 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts being “A GNU Manual,” and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled “GNU Free Documentation License” in the Emacs manual.(a) The FSF's Back-Cover Text is: “You have the freedom to copy and modify this GNU manual. Buying copies from the FSF supports it in developing GNU and promoting software freedom.”
This document is part of a collection distributed under the GNU Free Documentation License. If you want to distribute this document separately from the collection, you can do so by adding a copy of the license to the document, as described in section 6 of the license.
EasyPG Assistant provides the following features.
EasyPG Assistant commands are prefixed by ‘epa-’. For example,
EasyPG Assistant provides several cryptographic features which can be integrated into other Emacs functionalities. For example, automatic encryption/decryption of ‘*.gpg’ files.
This chapter introduces various commands for typical use cases.
Probably the first step of using EasyPG Assistant is to browse your keyring. M-x epa-list-keys is corresponding to ‘gpg --list-keys’ from the command line.
The output looks as follows.
u A5B6B2D4B15813FE Daiki Ueno <ueno@unixuser.org>
A character on the leftmost column indicates the trust level of the key. If it is ‘u’, the key is marked as ultimately trusted. The second column is the key ID, and the rest is the user ID.
You can move over entries by <TAB>. If you type <RET> or click button1 on an entry, you will see more detailed information about the key you selected.
u Daiki Ueno <ueno@unixuser.org>
u A5B6B2D4B15813FE 1024bits DSA
Created: 2001-10-09
Expires: 2007-09-04
Capabilities: sign certify
Fingerprint: 8003 7CD0 0F1A 9400 03CA 50AA A5B6 B2D4 B158 13FE
u 4447461B2A9BEA2D 2048bits ELGAMAL_E
Created: 2001-10-09
Expires: 2007-09-04
Capabilities: encrypt
Fingerprint: 9003 D76B 73B7 4A8A E588 10AF 4447 461B 2A9B EA2D
To browse your private keyring, use M-x epa-list-secret-keys.
In ‘*Keys*’ buffer, several commands are available. The common use case is to export some keys to a file. To do that, type m to select keys, type o, and then supply the filename.
Below are other commands related to key management. Some of them take a file as input/output, and others take the current region.
Insert selected keys after the point. It will let you select keys before insertion. By default, it will encode keys in the OpenPGP armor format.
Import keys from the current region between start and end to your keyring.
Import keys in the OpenPGP armor format in the current region between start and end. The difference from
epa-import-keys-regionis thatepa-import-armor-in-regionsearches armors in the region and appliesepa-import-keys-regionto each of them.
Delete selected keys. If allow-secret is non-
nil, it also delete the secret keys.
Decrypt the current region between start and end. It replaces the region with the decrypted text.
Decrypt OpenPGP armors in the current region between start and end. The difference from
epa-decrypt-regionis thatepa-decrypt-armor-in-regionsearches armors in the region and appliesepa-decrypt-regionto each of them. That is, this command does not alter the original text around armors.
Verify the current region between start and end. It sends the verification result to the minibuffer or a popup window. It replaces the region with the signed text.
Verify OpenPGP cleartext blocks in the current region between start and end. The difference from
epa-verify-regionis thatepa-verify-cleartext-in-regionsearches OpenPGP cleartext blocks in the region and appliesepa-verify-regionto each of them. That is, this command does not alter the original text around OpenPGP cleartext blocks.
Sign the current region between start and end. By default, it creates a cleartext signature. If a prefix argument is given, it will let you select signing keys, and then a signature type.
Encrypt the current region between start and end. It will let you select recipients. If a prefix argument is given, it will also ask you whether or not to sign the text before encryption and if you answered yes, it will let you select the signing keys.
Sign file. If a prefix argument is given, it will let you select signing keys, and then a signature type.
EasyPG Assistant extends Dired Mode for GNU Emacs to allow users to easily do cryptographic operations on files. For example,
M-x dired
(mark some files)
: e (or M-x epa-dired-do-encrypt)
(select recipients by 'm' and click [OK])
The following keys are assigned.
EasyPG Assistant provides a minor mode epa-mail-mode to help
user compose inline PGP messages. Inline PGP is a traditional style
of sending signed/encrypted emails by embedding raw OpenPGP blobs
inside a message body, not using modern MIME format.
NOTE: Inline PGP is not recommended and you should consider to use PGP/MIME. See Mm'kay?.
Once epa-mail-mode is enabled, the following keys are assigned.
You can do it by C-u 1 M-x epa-mail-mode or through the Customize
interface. Try M-x customize-variable epa-global-mail-mode.
By default, every file whose extension is ‘.gpg’ will be treated as encrypted. That is, when you attempt to open such a file which already exists, the decrypted text is inserted in the buffer rather than encrypted one. On the other hand, when you attempt to save the buffer to a file whose extension is ‘.gpg’, encrypted data is written.
If you want to temporarily disable this behavior, use M-x epa-file-disable, and then to enable this behavior use M-x epa-file-enable.
epa-file will let you select recipients. If you want to
suppress this question, it might be a good idea to put the following
line on the first line of the text being encrypted.
;; -*- epa-file-encrypt-to: ("ueno@unixuser.org") -*-
|
The file name extension of encrypted files can be controlled by epa-file-name-regexp.
Other variables which control the automatic encryption/decryption behavior are below.