Whole document tree
    

Whole document tree

Mailcrypt: An EMACS Interface to PGP: General Use
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. General Use

By default, Mailcrypt assumes you are using one of the PGP 2.6.x versions. This permits backward compatibility for the millions of satisfied users of Mailcrypt 3.4 worldwide. If you wish to specify a different version of PGP, use this function. Its action is the same as setting the variable mc-default-scheme. For a list of supported versions, press the tab key. "2.6" means 2.6.x, the original (and default). "5.0" is pgp 5.0. "gpg" is GnuPG.

Mailcrypt works by providing two minor modes for interfacing with cryptographic functions: mc-read-mode and mc-write-mode. mc-read-mode provides key bindings for processing messages which you have received; mc-write-mode provides key bindings for processing messages which you are about to send. These minor modes will indicate when they are active by placing a characteristic string in the mode line (see section 6.3 Mode Line). They will also add a Mailcrypt pull-down menu to the menu bar.

The normal installation procedure (see section 1.2 Installation) will arrange for the appropriate mode to be active when you read and compose mail and news. But you may want to use Mailcrypt's functions at other times; to do so, you can call mc-install-read-mode or mc-install-write-mode directly. For example, if you were editing a file in Text mode and wanted to digitally sign it, you would type M-x mc-install-write-mode, then C-c / s (see section 2.2 Signing a Message).

Once one of the Mailcrypt modes is active, you can get a summary of the available functions by typing C-h m or by examining the Mailcrypt pull-down menu.

The description of each function below includes which of the modes has a binding for that function.

2.1 Encrypting a Message  Encrypting a message to one or more recipients.
2.2 Signing a Message  Clearsigning a message.
2.3 Inserting a Public Key Block  Extracting a key from your public key ring and inserting it.
2.4 Decrypting a message  Decrypting a message to you.
2.5 Verifying a Signature  Verifying the signature on a clearsigned message.
2.6 Snarfing a Key  Finding a key in the current message and adding it to your keyring.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1 Encrypting a Message

The function mc-encrypt will encrypt a message in the current buffer. mc-write-mode binds this function to C-c / e by default.

When this function is called, Mailcrypt will prompt you for a comma-separated list of recipients. If called from a mail composition buffer, the recipient list will default to the Email addresses in the `To', `CC', and `BCC' lines of the message.

If you want to be able to decrypt the message yourself, you need to add yourself to the recipient list. If you always want to do so, set the variable mc-encrypt-for-me to t. (Note that Mailcrypt overrides the PGP "encrypttoself" flag; use this variable instead.)

If you provide an empty recipient list, Mailcrypt will ASCII-armor the message without encrypting it.

Once you have edited the recipient list to your satisfaction, type RET to accept it. You will then be asked whether you want to sign the message; answer y or n. You can avoid this question by setting the variable mc-pgp-always-sign: A value of t means "yes", a value of 'never means "no".

If you elect to sign the message, Mailcrypt will prompt you for the appropriate passphrase unless it is cached (see section 4. Passphrase Cache).

Mailcrypt will then pass the message to PGP for processing. Mailcrypt will call the functions listed in mc-pre-encryption-hook and mc-post-encryption-hook immediately before and after processing, respectively. The encrypted message will then replace the original message in the buffer. You can undo the encryption with the normal Emacs undo command C-x u (see section `Undoing Changes' in The GNU Emacs Manual).

If an error occurs, Mailcrypt will display an appropriate diagnostic. If you do not have the public key for one of the specified recipients, Mailcrypt will offer to try to fetch it for you (see section 5. Key Fetching).

The default key for signing is the first one on the secret key ring which matches the string mc-pgp-user-id; this defaults to (user-login-name). Note that this differs from PGP's normal default, which is to use the first of all of the secret keys. To mimic PGP's behavior, set this variable to "". This variable is specific to pgp 2.6.x; mc-pgp50-user-id and mc-gpg-user-id are the corresponding variables for pgp 5.0 and GnuPG.

If you want to use a secret key other than your default for signing the message, pass a prefix argument to mc-encrypt. (That is, type C-u C-c / e.) Mailcrypt will prompt for a string and will sign with the first key on your secret keyring which matches that string. It will be assumed that you want to sign the message, so you will not be prompted.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2 Signing a Message

The function mc-sign will clearsign a message in the current buffer. mc-write-mode binds this function to C-c / s by default.

When this function is called, Mailcrypt will prompt you for the appropriate passphrase unless it is cached (see section 4. Passphrase Cache).

Mailcrypt will then pass the message to PGP for processing. Mailcrypt will call the functions listed in mc-pre-signature-hook and mc-post-signature-hook immediately before and after processing, respectively. The signed message will replace the original message in the buffer. Do not edit the message further with the signature attached, because the signature would then be incorrect. If you discover you need to edit a message after you have signed it, remove the signature first with the normal Emacs undo command C-x u (see section `Undoing Changes' in The GNU Emacs Manual).

The variable mc-pgp-user-id controls which secret key is used for signing; it is described in Encrypting a Message. To use a different secret key, pass a prefix argument to mc-sign. (That is, type C-u C-c / s.) Mailcrypt will prompt for a string and will sign with the first key on your secret keyring which matches that string.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3 Inserting a Public Key Block

The function mc-insert-public-key will extract a key from your public keyring and insert it into the current buffer. mc-write-mode binds this function to C-c / x by default.

This function is useful for sending your public key to someone else or for uploading it to the key servers (see section 9.2 Key Servers). The inserted key will be the first one on your public key ring which matches the string mc-pgp-user-id (see section Encrypting a Message).

You may want to insert a different public key instead; for example, you may have signed someone's key and want to send it back to them. To do so, pass a prefix argument to mc-insert-public-key. (That is, type C-u C-c / x.) You will be prompted for a string; the first key on your public key ring which matches that string will be inserted.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.4 Decrypting a message

The function mc-decrypt will decrypt a message in the current buffer. mc-read-mode binds this function to C-c / d by default.

When this function is called, Mailcrypt will prompt you for the appropriate passphrase unless it is cached (see section 4. Passphrase Cache).

The encrypted message will then be passed to PGP for processing. If you are not in a mail buffer, the decrypted message will replace the encrypted form. If you are in a mail buffer, you will be prompted whether to do the replacement.

If you answer n, you will be placed in a new mail reading buffer to view the decrypted message. This new mail reading buffer will have no corresponding disk file; its purpose is to provide you with all of your usual reply and citation functions without requiring you to save the message in decrypted form. Type q to kill this buffer.

You can avoid the question of whether to replace the encrypted message by setting the variable mc-always-replace. A value of t means "yes"; a value of 'never means "no".

If the encrypted message is also signed, PGP will attempt to verify the signature. If the verification fails because you lack the necessary public key, Mailcrypt will offer to fetch it for you (see section 5. Key Fetching).

Look in the *MailCrypt* buffer to see the result of the signature verification.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.5 Verifying a Signature

The function mc-verify will verify the cleartext signature on a message in the current buffer. mc-read-mode binds this function to C-c / v by default.

When this function is called, Mailcrypt will pass the message to PGP for processing and report whether or not the signature verified.

If the signature failed to verify because you lack the necessary public key, Mailcrypt will offer to fetch it for you (see section 5. Key Fetching).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.6 Snarfing a Key

The function mc-snarf will add to your keyring any keys in the current buffer. mc-read-mode binds this function to C-c / a by default.

This function is useful when someone sends you a public key in an Email message.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Davide G. M. Salvetti on April, 12 2002 using texi2html