From 53eb4ff8025b4f554ae33c81ee51113284a594ac Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 25 Apr 2006 05:37:00 +0000 Subject: [PATCH] Allow user to select signers. --- epa-dired.el | 8 ++++++-- epa.el | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) 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)))) -- 1.7.10.4