* epg.el (epg-sign-file): Signal an error only when a signature is not
[elisp/epg.git] / pgg-epg.el
index 39167da..345cc7c 100644 (file)
@@ -67,9 +67,12 @@ passphrase cache or user."
        (setq cipher
              (epg-encrypt-string context
                                  (buffer-substring start end)
-                                 (if pgg-encrypt-for-me
-                                     (cons pgg-default-user-id recipients)
-                                   recipients)
+                                 (mapcar
+                                  (lambda (recipient)
+                                    (car (epg-list-keys recipient)))
+                                  (if pgg-encrypt-for-me
+                                      (cons pgg-default-user-id recipients)
+                                    recipients))
                                  sign t)
              pgg-epg-secret-key-id-list nil)
       (error