Fixed.
[elisp/epg.git] / pgg-epg.el
index 224535e..8d5cf8e 100644 (file)
@@ -80,7 +80,7 @@ passphrase cache or user."
                                  (buffer-substring start end)
                                  (mapcar
                                   (lambda (recipient)
-                                    (car (epg-list-keys recipient)))
+                                    (car (epg-list-keys context recipient)))
                                   (if pgg-encrypt-for-me
                                       (cons pgg-default-user-id recipients)
                                     recipients))
@@ -252,7 +252,7 @@ Add all public keys in region between START and END to the keyring."
             (fprint (epg-signature-fingerprint (car pgg-epg-signatures)))
             (trust-good-enough-p
              (memq (epg-signature-validity (car pgg-epg-signatures))
-                   '(marginal fully ultimate))))
+                   '(marginal full ultimate))))
        (cond ((and signer fprint)
               (concat (cdr signer)
                       (unless trust-good-enough-p
@@ -265,6 +265,12 @@ Add all public keys in region between START and END to the keyring."
               "From unknown user")))
     "From unknown user"))
 
+(defun pgg-epg-lookup-key (string &optional type)
+  "Search keys associated with STRING."
+  (mapcar (lambda (key)
+           (epg-sub-key-id (car (epg-key-sub-key-list key))))
+         (epg-list-keys (epg-make-context) string (not (null type)))))
+
 (provide 'pgg-epg)
 
 ;;; pgg-epg.el ends here