From: ueno Date: Tue, 25 Apr 2006 05:37:00 +0000 (+0000) Subject: Allow user to select signers. X-Git-Tag: epg-0_0_1~24 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=53eb4ff8025b4f554ae33c81ee51113284a594ac;p=elisp%2Fepg.git Allow user to select signers. --- diff --git a/epa-dired.el b/epa-dired.el index ddb5805..3eea591 100644 --- a/epa-dired.el +++ b/epa-dired.el @@ -61,8 +61,12 @@ (interactive) (let ((file-list (dired-get-marked-files))) (while file-list - (epa-sign-file (expand-file-name (car file-list)) - (y-or-n-p "Make a detached signature? ")) + (epa-sign-file + (expand-file-name (car file-list)) + (epa-select-keys (epg-make-context) "Select keys for signing. +If no one is selected, default secret key is used. " + nil t) + (y-or-n-p "Make a detached signature? ")) (setq file-list (cdr file-list))) (revert-buffer))) diff --git a/epa.el b/epa.el index d5a5eba..c4f8700 100644 --- a/epa.el +++ b/epa.el @@ -476,13 +476,17 @@ (epg-verify-result-to-string (epg-context-result-for context 'verify))))) -(defun epa-sign-file (file detached) +(defun epa-sign-file (file signers detached) (interactive (list (expand-file-name (read-file-name "File: ")) + (epa-select-keys (epg-make-context) "Select keys for signing. +If no one is selected, default secret key is used. " + nil t) (y-or-n-p "Make a detached signature? "))) (let ((signature (concat file (if detached ".sig" ".gpg"))) (context (epg-make-context))) (message "Signing %s..." (file-name-nondirectory file)) + (epg-context-set-signers context signers) (epg-sign-file context file signature (not (null detached))) (message "Signing %s...done" (file-name-nondirectory file))))