From 0b55b55296d1494fe6ee9a3b44c39bb36cc8f140 Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 18 Apr 2006 09:31:42 +0000 Subject: [PATCH] * epa.el (epa-keys-mode-map): Bind epa-list-keys; epa-import-key. (epa-import-key): New command. --- ChangeLog | 3 +++ epa.el | 20 +++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 42cd156..5524973 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-04-18 Daiki Ueno + * epa.el (epa-keys-mode-map): Bind epa-list-keys; epa-import-key. + (epa-import-key): New command. + * epg.el (epg-delete-problem-alist): New constant. (epg-status-DELETE_PROBLEM): New function. (epg-start-delete-key): New function. diff --git a/epa.el b/epa.el index ec65290..da9e000 100644 --- a/epa.el +++ b/epa.el @@ -154,6 +154,8 @@ (define-key keymap "s" 'epa-sign-file) (define-key keymap "e" 'epa-encrypt-file) (define-key keymap "r" 'epa-delete-key) + (define-key keymap "i" 'epa-import-key) + (define-key keymap "g" 'epa-list-keys) (define-key keymap "n" 'next-line) (define-key keymap "p" 'previous-line) (define-key keymap " " 'scroll-up) @@ -239,9 +241,13 @@ ;;;###autoload (defun epa-list-keys (&optional name mode) (interactive - (let ((name (read-string "Pattern: "))) - (list (if (equal name "") nil name) - current-prefix-arg))) + (if current-prefix-arg + (let ((name (read-string "Pattern: " + (if epa-list-keys-arguments + (car epa-list-keys-arguments))))) + (list (if (equal name "") nil name) + (y-or-n-p "Secret keys? "))) + (or epa-list-keys-arguments (list nil nil)))) (unless (and epa-keys-buffer (buffer-live-p epa-keys-buffer)) (setq epa-keys-buffer (generate-new-buffer "*Keys*"))) @@ -478,6 +484,14 @@ If no one is selected, symmetric encryption will be performed. ")))) (message "Deleting %s...done" (epg-sub-key-id (car (epg-key-sub-key-list key)))))) +(defun epa-import-key (file) + (interactive "sFile: ") + (let ((context (epg-make-context))) + (message "Importing %s..." (file-name-nondirectory file)) + (epg-import-key context file) + (apply #'epa-list-keys epa-list-keys-arguments) + (message "Importing %s...done" (file-name-nondirectory file)))) + (provide 'epa) ;;; epa.el ends here -- 1.7.10.4