From 185699e93bc897cd02ad2eb65e1ed658c52526f8 Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 17 Apr 2006 01:58:52 +0000 Subject: [PATCH] * epg.el (epg-invalid-recipients-alist): New variable. (epg-status-INV_RECP): New function. (epg-status-NO_RECP): New function. --- ChangeLog | 4 ++++ epg.el | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/ChangeLog b/ChangeLog index a742569..4135c7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-04-17 Daiki Ueno + * epg.el (epg-invalid-recipients-alist): New variable. + (epg-status-INV_RECP): New function. + (epg-status-NO_RECP): New function. + * epa.el (epa-keys-mode-map): Bind epa-decrypt-file, epa-verify-file, epa-sign-file, and epa-encrypt-file. (epa-decrypt-file): New function imported from epa-dired.el. diff --git a/epg.el b/epg.el index 819d53a..77d445b 100644 --- a/epg.el +++ b/epg.el @@ -83,6 +83,19 @@ (2 . "ZLIB") (3 . "BZIP2"))) +(defconst epg-invalid-recipients-alist + '((0 . "No specific reason given") + (1 . "Not Found") + (2 . "Ambigious specification") + (3 . "Wrong key usage") + (4 . "Key revoked") + (5 . "Key expired") + (6 . "No CRL known") + (7 . "CRL too old") + (8 . "Policy mismatch") + (9 . "Not a secret key") + (10 . "Key not trusted"))) + (defvar epg-key-validity-alist '((?o . unknown) (?i . invalid) @@ -641,6 +654,20 @@ This function is for internal use only." (cons 'bad-armor (epg-context-result-for epg-context 'error)))) +(defun epg-status-INV_RECP (process string) + (if (string-match "\\`\\([0-9]+\\) \\(.*\\)" string) + (epg-context-set-result-for + epg-context 'error + (cons (cons 'invalid-recipient + (string-to-number (match-string 1 string))) + (epg-context-result-for epg-context 'error))))) + +(defun epg-status-NO_RECP (process string) + (epg-context-set-result-for + epg-context 'error + (cons 'no-recipients + (epg-context-result-for epg-context 'error)))) + (defun epg-passphrase-callback-function (key-id handback) (read-passwd (if (eq key-id 'SYM) -- 1.7.10.4