(setcdr entry value)
(epg-context-set-result context (cons (cons name value) result)))))
-(defun epg-key-image (key-id)
- "Return the image of a key, if any"
- (let ((filename
- (replace-regexp-in-string
- "\n" ""
- (shell-command-to-string
- (concat "/usr/bin/gpg --photo-viewer 'echo %I >&2' --list-keys "
- key-id " > /dev/null")))))
- (when (and (not (string-equal filename ""))
- (file-exists-p filename))
- (create-image filename))))
-
-(defun epg-key-image-to-string (key-id)
- "Return a string with the image of a key, if any"
- (let* ((result "")
- (key-image (epg-key-image key-id)))
- (when key-image
- (setq result " ")
- (put-text-property 1 2 'display key-image result))
- result))
-
(defun epg-signature-to-string (signature)
"Convert SIGNATURE to a human readable string."
(let* ((user-id (cdr (assoc (epg-signature-key-id signature)
epg-user-id-alist)))
(pubkey-algorithm (epg-signature-pubkey-algorithm signature))
- (key-id (epg-signature-key-id signature))
- (key-image (epg-key-image-to-string key-id)))
+ (key-id (epg-signature-key-id signature)))
(concat
(cond ((eq (epg-signature-status signature) 'good)
"Good signature from ")
((eq (epg-signature-status signature) 'no-pubkey)
"No public key for "))
key-id
- key-image
(if user-id
(concat " "
(if (stringp user-id)
+2012-12-26 Daiki Ueno <ueno@gnu.org>
+
+ * mml2015.el (mml2015-epg-signature-to-string): New function.
+ (mml2015-epg-verify-result-to-string): New function.
+ (mml2015-epg-decrypt, mml2015-epg-clear-decrypt, mml2015-epg-verify)
+ (mml2015-epg-clear-verify): Use mml2015-epg-verify-result-to-string
+ instead of epg-verify-result-to-string.
+ (epg-signature-key-id, epg-signature-to-string): Autoload.
+ (epg-verify-result-to-string): Remove autoload.
+
+2012-12-25 Adam Sjøgren <asjo@koldfront.dk>
+
+ * mml2015.el (mml2015-epg-key-image): New function, to retrieve photo
+ ID image from GPG public key.
+ (mml2015-epg-key-image-to-string): New function.
+
2012-12-25 Leo Liu <sdl.web@gmail.com>
* plstore.el (plstore-passphrase-callback-function): Fix error when
(defvar epg-user-id-alist)
(defvar epg-digest-algorithm-alist)
+(defvar epg-gpg-program)
(defvar inhibit-redisplay)
(autoload 'epg-make-context "epg")
(autoload 'epg-context-set-signers "epg")
(autoload 'epg-context-result-for "epg")
(autoload 'epg-new-signature-digest-algorithm "epg")
-(autoload 'epg-verify-result-to-string "epg")
(autoload 'epg-list-keys "epg")
(autoload 'epg-decrypt-string "epg")
(autoload 'epg-verify-string "epg")
(autoload 'epg-sub-key-capability "epg")
(autoload 'epg-sub-key-validity "epg")
(autoload 'epg-sub-key-fingerprint "epg")
+(autoload 'epg-signature-key-id "epg")
+(autoload 'epg-signature-to-string "epg")
(autoload 'epg-configuration "epg-config")
(autoload 'epg-expand-group "epg-config")
(autoload 'epa-select-keys "epa")
(setq secret-keys (cdr secret-keys))))
secret-key))
+(defun mml2015-epg-key-image (key-id)
+ "Return the image of a key, if any"
+ (let ((filename
+ (replace-regexp-in-string
+ "\n" ""
+ (shell-command-to-string
+ (format "%s --photo-viewer 'echo %%I >&2' --list-keys %s > /dev/null"
+ epg-gpg-program key-id)))))
+ (when (and (not (string-equal filename ""))
+ (file-exists-p filename))
+ (create-image filename))))
+
+(defun mml2015-epg-key-image-to-string (key-id)
+ "Return a string with the image of a key, if any"
+ (let* ((result "")
+ (key-image (mml2015-epg-key-image key-id)))
+ (when key-image
+ (setq result " ")
+ (put-text-property 1 2 'display key-image result))
+ result))
+
+(defun mml2015-epg-signature-to-string (signature)
+ (concat (epg-signature-to-string signature)
+ (mml2015-epg-key-image-to-string (epg-signature-key-id signature))))
+
+(defun mml2015-epg-verify-result-to-string (verify-result)
+ (mapconcat #'mml2015-epg-signature-to-string verify-result "\n"))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info
(concat "OK\n"
- (epg-verify-result-to-string
+ (mml2015-epg-verify-result-to-string
(epg-context-result-for context 'verify))))
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info "OK"))
(if (epg-context-result-for context 'verify)
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-details
- (epg-verify-result-to-string
+ (mml2015-epg-verify-result-to-string
(epg-context-result-for context 'verify)))))))
(defun mml2015-epg-verify (handle ctl)
(throw 'error handle)))
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info
- (epg-verify-result-to-string (epg-context-result-for context 'verify)))
+ (mml2015-epg-verify-result-to-string
+ (epg-context-result-for context 'verify)))
handle)))
(defun mml2015-epg-clear-verify ()
(progn
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info
- (epg-verify-result-to-string
+ (mml2015-epg-verify-result-to-string
(epg-context-result-for context 'verify)))
(delete-region (point-min) (point-max))
(insert (mm-decode-coding-string plain coding-system-for-read)))