3.1 Key Management

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.

Command: epa-list-keys name mode

Show all keys matched with name from the public keyring.

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.

Command: epa-list-secret-keys name

Show all keys matched with name from the private keyring.

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.

Command: epa-insert-keys keys

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.

Command: epa-import-keys file

Import keys from file to your keyring.

Command: epa-import-keys-region start end

Import keys from the current region between start and end to your keyring.

Command: epa-import-armor-in-region start end

Import keys in the OpenPGP armor format in the current region between start and end. The difference from epa-import-keys-region is that epa-import-armor-in-region searches armors in the region and applies epa-import-keys-region to each of them.

Command: epa-delete-keys allow-secret

Delete selected keys. If allow-secret is non-nil, it also delete the secret keys.