epa 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. This is ../../info/epa, produced by makeinfo version 4.13 from epa.texi.
  2. This file describes EasyPG Assistant 1.0.0.
  3. Copyright (C) 2007-2012 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this
  5. document under the terms of the GNU Free Documentation License,
  6. Version 1.3 or any later version published by the Free Software
  7. Foundation; with no Invariant Sections, with the Front-Cover texts
  8. being "A GNU Manual," and with the Back-Cover Texts as in (a)
  9. below. A copy of the license is included in the section entitled
  10. "GNU Free Documentation License" in the Emacs manual.
  11. (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
  12. modify this GNU manual. Buying copies from the FSF supports it in
  13. developing GNU and promoting software freedom."
  14. This document is part of a collection distributed under the GNU
  15. Free Documentation License. If you want to distribute this
  16. document separately from the collection, you can do so by adding a
  17. copy of the license to the document, as described in section 6 of
  18. the license.
  19. INFO-DIR-SECTION Emacs misc features
  20. START-INFO-DIR-ENTRY
  21. * EasyPG Assistant: (epa). An Emacs user interface to GNU Privacy Guard.
  22. END-INFO-DIR-ENTRY
  23. 
  24. File: epa, Node: Top, Next: Overview, Up: (dir)
  25. EasyPG Assistant user's manual
  26. ******************************
  27. EasyPG Assistant is an Emacs user interface to GNU Privacy Guard
  28. (GnuPG, *note Top: (gnupg)Top.).
  29. EasyPG Assistant is a part of the package called EasyPG, an
  30. all-in-one GnuPG interface for Emacs. EasyPG also contains the library
  31. interface called EasyPG Library.
  32. This file describes EasyPG Assistant 1.0.0.
  33. Copyright (C) 2007-2012 Free Software Foundation, Inc.
  34. Permission is granted to copy, distribute and/or modify this
  35. document under the terms of the GNU Free Documentation License,
  36. Version 1.3 or any later version published by the Free Software
  37. Foundation; with no Invariant Sections, with the Front-Cover texts
  38. being "A GNU Manual," and with the Back-Cover Texts as in (a)
  39. below. A copy of the license is included in the section entitled
  40. "GNU Free Documentation License" in the Emacs manual.
  41. (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
  42. modify this GNU manual. Buying copies from the FSF supports it in
  43. developing GNU and promoting software freedom."
  44. This document is part of a collection distributed under the GNU
  45. Free Documentation License. If you want to distribute this
  46. document separately from the collection, you can do so by adding a
  47. copy of the license to the document, as described in section 6 of
  48. the license.
  49. * Menu:
  50. * Overview::
  51. * Quick start::
  52. * Commands::
  53. * Caching Passphrases::
  54. * Bug Reports::
  55. 
  56. File: epa, Node: Overview, Next: Quick start, Prev: Top, Up: Top
  57. 1 Overview
  58. **********
  59. EasyPG Assistant provides the following features.
  60. * Key management.
  61. * Cryptographic operations on regions.
  62. * Cryptographic operations on files.
  63. * Dired integration.
  64. * Mail-mode integration.
  65. * Automatic encryption/decryption of *.gpg files.
  66. 
  67. File: epa, Node: Quick start, Next: Commands, Prev: Overview, Up: Top
  68. 2 Quick start
  69. *************
  70. EasyPG Assistant commands are prefixed by `epa-'. For example,
  71. * To browse your keyring, type `M-x epa-list-keys'
  72. * To create a cleartext signature of the region, type `M-x
  73. epa-sign-region'
  74. * To encrypt a file, type `M-x epa-encrypt-file'
  75. EasyPG Assistant provides several cryptographic features which can be
  76. integrated into other Emacs functionalities. For example, automatic
  77. encryption/decryption of `*.gpg' files.
  78. 
  79. File: epa, Node: Commands, Next: Caching Passphrases, Prev: Quick start, Up: Top
  80. 3 Commands
  81. **********
  82. This chapter introduces various commands for typical use cases.
  83. * Menu:
  84. * Key management::
  85. * Cryptographic operations on regions::
  86. * Cryptographic operations on files::
  87. * Dired integration::
  88. * Mail-mode integration::
  89. * Encrypting/decrypting *.gpg files::
  90. 
  91. File: epa, Node: Key management, Next: Cryptographic operations on regions, Up: Commands
  92. 3.1 Key management
  93. ==================
  94. Probably the first step of using EasyPG Assistant is to browse your
  95. keyring. `M-x epa-list-keys' is corresponding to `gpg --list-keys'
  96. from the command line.
  97. -- Command: epa-list-keys name mode
  98. Show all keys matched with NAME from the public keyring.
  99. The output looks as follows.
  100. u A5B6B2D4B15813FE Daiki Ueno <ueno@unixuser.org>
  101. A character on the leftmost column indicates the trust level of the
  102. key. If it is `u', the key is marked as ultimately trusted. The
  103. second column is the key ID, and the rest is the user ID.
  104. You can move over entries by <TAB>. If you type <RET> or click
  105. button1 on an entry, you will see more detailed information about the
  106. key you selected.
  107. u Daiki Ueno <ueno@unixuser.org>
  108. u A5B6B2D4B15813FE 1024bits DSA
  109. Created: 2001-10-09
  110. Expires: 2007-09-04
  111. Capabilities: sign certify
  112. Fingerprint: 8003 7CD0 0F1A 9400 03CA 50AA A5B6 B2D4 B158 13FE
  113. u 4447461B2A9BEA2D 2048bits ELGAMAL_E
  114. Created: 2001-10-09
  115. Expires: 2007-09-04
  116. Capabilities: encrypt
  117. Fingerprint: 9003 D76B 73B7 4A8A E588 10AF 4447 461B 2A9B EA2D
  118. To browse your private keyring, use `M-x epa-list-secret-keys'.
  119. -- Command: epa-list-secret-keys name
  120. Show all keys matched with NAME from the private keyring.
  121. In `*Keys*' buffer, several commands are available. The common use
  122. case is to export some keys to a file. To do that, type `m' to select
  123. keys, type `o', and then supply the filename.
  124. Below are other commands related to key management. Some of them
  125. take a file as input/output, and others take the current region.
  126. -- Command: epa-insert-keys keys
  127. Insert selected KEYS after the point. It will let you select keys
  128. before insertion. By default, it will encode keys in the OpenPGP
  129. armor format.
  130. -- Command: epa-import-keys file
  131. Import keys from FILE to your keyring.
  132. -- Command: epa-import-keys-region start end
  133. Import keys from the current region between START and END to your
  134. keyring.
  135. -- Command: epa-import-armor-in-region start end
  136. Import keys in the OpenPGP armor format in the current region
  137. between START and END. The difference from
  138. `epa-import-keys-region' is that `epa-import-armor-in-region'
  139. searches armors in the region and applies `epa-import-keys-region'
  140. to each of them.
  141. -- Command: epa-delete-keys allow-secret
  142. Delete selected keys. If ALLOW-SECRET is non-`nil', it also
  143. delete the secret keys.
  144. 
  145. File: epa, Node: Cryptographic operations on regions, Next: Cryptographic operations on files, Prev: Key management, Up: Commands
  146. 3.2 Cryptographic operations on regions
  147. =======================================
  148. -- Command: epa-decrypt-region start end
  149. Decrypt the current region between START and END. It replaces the
  150. region with the decrypted text.
  151. -- Command: epa-decrypt-armor-in-region start end
  152. Decrypt OpenPGP armors in the current region between START and
  153. END. The difference from `epa-decrypt-region' is that
  154. `epa-decrypt-armor-in-region' searches armors in the region and
  155. applies `epa-decrypt-region' to each of them. That is, this
  156. command does not alter the original text around armors.
  157. -- Command: epa-verify-region start end
  158. Verify the current region between START and END. It sends the
  159. verification result to the minibuffer or a popup window. It
  160. replaces the region with the signed text.
  161. -- Command: epa-verify-cleartext-in-region
  162. Verify OpenPGP cleartext blocks in the current region between
  163. START and END. The difference from `epa-verify-region' is that
  164. `epa-verify-cleartext-in-region' searches OpenPGP cleartext blocks
  165. in the region and applies `epa-verify-region' to each of them.
  166. That is, this command does not alter the original text around
  167. OpenPGP cleartext blocks.
  168. -- Command: epa-sign-region start end signers type
  169. Sign the current region between START and END. By default, it
  170. creates a cleartext signature. If a prefix argument is given, it
  171. will let you select signing keys, and then a signature type.
  172. -- Command: epa-encrypt-region start end recipients sign signers
  173. Encrypt the current region between START and END. It will let you
  174. select recipients. If a prefix argument is given, it will also
  175. ask you whether or not to sign the text before encryption and if
  176. you answered yes, it will let you select the signing keys.
  177. 
  178. File: epa, Node: Cryptographic operations on files, Next: Dired integration, Prev: Cryptographic operations on regions, Up: Commands
  179. 3.3 Cryptographic operations on files
  180. =====================================
  181. -- Command: epa-decrypt-file file
  182. Decrypt FILE.
  183. -- Command: epa-verify-file file
  184. Verify FILE.
  185. -- Command: epa-sign-file file signers type
  186. Sign FILE. If a prefix argument is given, it will let you select
  187. signing keys, and then a signature type.
  188. -- Command: epa-encrypt-file file recipients
  189. Encrypt FILE. It will let you select recipients.
  190. 
  191. File: epa, Node: Dired integration, Next: Mail-mode integration, Prev: Cryptographic operations on files, Up: Commands
  192. 3.4 Dired integration
  193. =====================
  194. EasyPG Assistant extends Dired Mode for GNU Emacs to allow users to
  195. easily do cryptographic operations on files. For example,
  196. M-x dired
  197. (mark some files)
  198. : e (or M-x epa-dired-do-encrypt)
  199. (select recipients by 'm' and click [OK])
  200. The following keys are assigned.
  201. `: d'
  202. Decrypt marked files.
  203. `: v'
  204. Verify marked files.
  205. `: s'
  206. Sign marked files.
  207. `: e'
  208. Encrypt marked files.
  209. 
  210. File: epa, Node: Mail-mode integration, Next: Encrypting/decrypting *.gpg files, Prev: Dired integration, Up: Commands
  211. 3.5 Mail-mode integration
  212. =========================
  213. EasyPG Assistant provides a minor mode `epa-mail-mode' to help user
  214. compose inline OpenPGP messages. Inline OpenPGP is a traditional style
  215. of sending signed/encrypted emails by embedding raw OpenPGP blobs
  216. inside a message body, not using modern MIME format.
  217. NOTE: Inline OpenPGP is not recommended and you should consider to
  218. use PGP/MIME. See Inline OpenPGP in E-mail is bad, Mm'kay?
  219. (http://josefsson.org/inline-openpgp-considered-harmful.html).
  220. Once `epa-mail-mode' is enabled, the following keys are assigned. You
  221. can do it by `C-u 1 M-x epa-mail-mode' or through the Customize
  222. interface. Try `M-x customize-variable epa-global-mail-mode'.
  223. `C-c C-e C-d and C-c C-e d'
  224. Decrypt OpenPGP armors in the current buffer.
  225. `C-c C-e C-v and C-c C-e v'
  226. Verify OpenPGP cleartext signed messages in the current buffer.
  227. `C-c C-e C-s and C-c C-e s'
  228. Compose a signed message from the current buffer.
  229. `C-c C-e C-e and C-c C-e e'
  230. Compose an encrypted message from the current buffer. By default
  231. it tries to build the recipient list from `to', `cc', and `bcc'
  232. fields of the mail header. To include your key in the recipient
  233. list, use `encrypt-to' option in `~/.gnupg/gpg.conf'.
  234. 
  235. File: epa, Node: Encrypting/decrypting *.gpg files, Prev: Mail-mode integration, Up: Commands
  236. 3.6 Encrypting/decrypting *.gpg files
  237. =====================================
  238. By default, every file whose name ends with `.gpg' will be treated as
  239. encrypted. That is, when you open such a file, the decrypted text is
  240. inserted in the buffer rather than encrypted one. Similarly, when you
  241. save the buffer to a `foo.gpg' file, encrypted data is written.
  242. The file name pattern for encrypted files can be controlled by
  243. EPA-FILE-NAME-REGEXP.
  244. -- Variable: epa-file-name-regexp
  245. Regexp which matches filenames treated as encrypted.
  246. You can disable this behavior with `M-x epa-file-disable', and then
  247. get it back with `M-x epa-file-enable'.
  248. -- Command: epa-file-disable
  249. Disable automatic encryption/decryption of *.gpg files.
  250. -- Command: epa-file-enable
  251. Enable automatic encryption/decryption of *.gpg files.
  252. By default, `epa-file' will try to use symmetric encryption, aka
  253. password-based encryption. If you want to use public key encryption
  254. instead, do `M-x epa-file-select-keys', which will pops up the key
  255. selection dialog.
  256. -- Command: epa-file-select-keys
  257. Select recipient keys to encrypt the currently visiting file with
  258. public key encryption.
  259. You can also change the default behavior with the variable
  260. EPA-FILE-SELECT-KEYS.
  261. -- Variable: epa-file-select-keys
  262. Control whether or not to pop up the key selection dialog.
  263. For frequently visited files, it might be a good idea to tell Emacs
  264. which encryption method should be used through *Note File Variables:
  265. (emacs)File Variables. Use the `epa-file-encrypt-to' local variable
  266. for this.
  267. For example, if you want an Elisp file should be encrypted with a
  268. public key associated with an email address `ueno@unixuser.org', add
  269. the following line to the beginning of the file.
  270. ;; -*- epa-file-encrypt-to: ("ueno@unixuser.org") -*-
  271. Instead, if you want the file always (regardless of the value of the
  272. `epa-file-select-keys' variable) encrypted with symmetric encryption,
  273. change the line as follows.
  274. ;; -*- epa-file-encrypt-to: nil -*-
  275. Other variables which control the automatic encryption/decryption
  276. behavior are below.
  277. -- Variable: epa-file-cache-passphrase-for-symmetric-encryption
  278. If non-`nil', cache passphrase for symmetric encryption. The
  279. default value is `nil'.
  280. -- Variable: epa-file-inhibit-auto-save
  281. If non-`nil', disable auto-saving when opening an encrypted file.
  282. The default value is `t'.
  283. 
  284. File: epa, Node: Caching Passphrases, Next: Bug Reports, Prev: Commands, Up: Top
  285. 4 Caching Passphrases
  286. *********************
  287. Typing passphrases is an irritating task if you frequently open and
  288. close the same file. GnuPG and EasyPG Assistant provide mechanisms to
  289. remember your passphrases. However, the configuration is a bit
  290. confusing since it depends on your GnuPG installation (GnuPG version 1
  291. or GnuPG version 2), encryption method (symmetric or public key), and
  292. whether or not you want to use gpg-agent. Here are some questions:
  293. 1. Do you use GnuPG version 2 instead of GnuPG version 1?
  294. 2. Do you use symmetric encryption rather than public key encryption?
  295. 3. Do you want to use gpg-agent?
  296. Here are configurations depending on your answers:
  297. 1 2 3 Configuration
  298. Yes Yes Yes Set up gpg-agent.
  299. Yes Yes No You can't, without gpg-agent.
  300. Yes No Yes Set up gpg-agent.
  301. Yes No No You can't, without gpg-agent.
  302. No Yes Yes Set up elisp passphrase cache.
  303. No Yes No Set up elisp passphrase cache.
  304. No No Yes Set up gpg-agent.
  305. No No No You can't, without gpg-agent.
  306. To set up gpg-agent, follow the instruction in GnuPG manual. *note
  307. Invoking GPG-AGENT: (gnupg)Invoking GPG-AGENT.
  308. To set up elisp passphrase cache, set
  309. `epa-file-cache-passphrase-for-symmetric-encryption'. *Note
  310. Encrypting/decrypting *.gpg files::.
  311. 
  312. File: epa, Node: Bug Reports, Prev: Caching Passphrases, Up: Top
  313. 5 Bug Reports
  314. *************
  315. Bugs and problems with EasyPG Assistant are actively worked on by the
  316. Emacs development team. Feature requests and suggestions are also more
  317. than welcome. Use `M-x report-emacs-bug', *note Bugs: (emacs)Bugs.
  318. When submitting a bug report, please try to describe in excruciating
  319. detail the steps required to reproduce the problem. Also try to
  320. collect necessary information to fix the bug, such as:
  321. * the GnuPG version. Send the output of `gpg --version'.
  322. * the GnuPG configuration. Send the contents of `~/.gnupg/gpg.conf'.
  323. Before reporting the bug, you should set `epg-debug' in the
  324. `~/.emacs' file and repeat the bug. Then, include the contents of the
  325. ` *epg-debug*' buffer. Note that the first letter of the buffer name
  326. is a whitespace.
  327. 
  328. Tag Table:
  329. Node: Top1303
  330. Node: Overview2856
  331. Node: Quick start3216
  332. Node: Commands3763
  333. Node: Key management4132
  334. Node: Cryptographic operations on regions6809
  335. Node: Cryptographic operations on files8797
  336. Node: Dired integration9387
  337. Node: Mail-mode integration9978
  338. Node: Encrypting/decrypting *.gpg files11371
  339. Node: Caching Passphrases13919
  340. Node: Bug Reports15332
  341. 
  342. End Tag Table