comparison lisp/gnus/pgg-pgp.el @ 65923:30343c286601

* pgg-pgp.el (pgg-pgp-decrypt-region): Use passphrase cache.
author Simon Josefsson <jas@extundo.com>
date Sat, 08 Oct 2005 08:45:31 +0000
parents fafd692d1e40
children
comparison
equal deleted inserted replaced
65922:ce1cf38cd09f 65923:30343c286601
147 (pgg-process-when-success nil))) 147 (pgg-process-when-success nil)))
148 148
149 (defun pgg-pgp-decrypt-region (start end) 149 (defun pgg-pgp-decrypt-region (start end)
150 "Decrypt the current region between START and END." 150 "Decrypt the current region between START and END."
151 (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id)) 151 (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
152 (key (pgg-pgp-lookup-key pgg-pgp-user-id 'encrypt))
152 (passphrase 153 (passphrase
153 (pgg-read-passphrase 154 (pgg-read-passphrase
154 (format "PGP passphrase for %s: " pgg-pgp-user-id) 155 (format "PGP passphrase for %s: " pgg-pgp-user-id) key))
155 (pgg-pgp-lookup-key pgg-pgp-user-id 'encrypt)))
156 (args 156 (args
157 '("+verbose=1" "+batchmode" "+language=us" "-f"))) 157 '("+verbose=1" "+batchmode" "+language=us" "-f")))
158 (pgg-pgp-process-region start end passphrase pgg-pgp-program args) 158 (pgg-pgp-process-region start end passphrase pgg-pgp-program args)
159 (pgg-process-when-success nil))) 159 (pgg-process-when-success
160 (if pgg-cache-passphrase
161 (pgg-add-passphrase-cache key passphrase)))))
160 162
161 (defun pgg-pgp-sign-region (start end &optional clearsign) 163 (defun pgg-pgp-sign-region (start end &optional clearsign)
162 "Make detached signature from text between START and END." 164 "Make detached signature from text between START and END."
163 (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id)) 165 (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
164 (passphrase 166 (passphrase