projects
/
elisp
/
epg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* epa-file.el (epa-file-write-region): Don't attempt to write the
[elisp/epg.git]
/
pgg-epg.el
diff --git
a/pgg-epg.el
b/pgg-epg.el
index
6445c4c
..
86c6155
100644
(file)
--- a/
pgg-epg.el
+++ b/
pgg-epg.el
@@
-29,14
+29,14
@@
;;; Code:
;;; Code:
-(require 'epg)
+(require 'epa)
(eval-when-compile (require 'pgg))
(defvar pgg-epg-secret-key-id-list nil)
(defun pgg-epg-passphrase-callback (context key-id ignore)
(if (eq key-id 'SYM)
(eval-when-compile (require 'pgg))
(defvar pgg-epg-secret-key-id-list nil)
(defun pgg-epg-passphrase-callback (context key-id ignore)
(if (eq key-id 'SYM)
- (epg-passphrase-callback-function context key-id nil)
+ (epa-passphrase-callback-function context key-id nil)
(let* ((entry (assoc key-id epg-user-id-alist))
(passphrase
(pgg-read-passphrase
(let* ((entry (assoc key-id epg-user-id-alist))
(passphrase
(pgg-read-passphrase
@@
-80,7
+80,7
@@
passphrase cache or user."
(buffer-substring start end)
(mapcar
(lambda (recipient)
(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))
(if pgg-encrypt-for-me
(cons pgg-default-user-id recipients)
recipients))
@@
-132,7
+132,8
@@
passphrase cache or user."
(pgg-remove-passphrase-from-cache (car pgg-epg-secret-key-id-list))
(setq pgg-epg-secret-key-id-list (cdr pgg-epg-secret-key-id-list)))
(signal (car error) (cdr error))))
(pgg-remove-passphrase-from-cache (car pgg-epg-secret-key-id-list))
(setq pgg-epg-secret-key-id-list (cdr pgg-epg-secret-key-id-list)))
(signal (car error) (cdr error))))
- (if pgg-text-mode
+ (if (and pgg-text-mode
+ (fboundp 'decode-coding-string))
(setq plain (decode-coding-string plain 'raw-text)))
(save-excursion
(set-buffer (get-buffer-create pgg-output-buffer))
(setq plain (decode-coding-string plain 'raw-text)))
(save-excursion
(set-buffer (get-buffer-create pgg-output-buffer))
@@
-152,6
+153,9
@@
passphrase cache or user."
(epg-context-set-armor context t)
(epg-context-set-textmode context pgg-text-mode)
(epg-context-set-passphrase-callback context #'pgg-epg-passphrase-callback)
(epg-context-set-armor context t)
(epg-context-set-textmode context pgg-text-mode)
(epg-context-set-passphrase-callback context #'pgg-epg-passphrase-callback)
+ (epg-context-set-signers
+ context
+ (list (car (epg-list-keys context pgg-default-user-id t))))
(save-excursion
(set-buffer (get-buffer-create pgg-output-buffer))
(erase-buffer)
(save-excursion
(set-buffer (get-buffer-create pgg-output-buffer))
(erase-buffer)
@@
-162,7
+166,7
@@
passphrase cache or user."
(epg-sign-string context
(buffer-substring start end)
(if cleartext
(epg-sign-string context
(buffer-substring start end)
(if cleartext
- 'clearsign
+ 'clear
'detached))
pgg-epg-secret-key-id-list nil)
(error
'detached))
pgg-epg-secret-key-id-list nil)
(error
@@
-249,7
+253,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))
(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
(cond ((and signer fprint)
(concat (cdr signer)
(unless trust-good-enough-p
@@
-262,6
+266,12
@@
Add all public keys in region between START and END to the keyring."
"From unknown user")))
"From unknown user"))
"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
(provide 'pgg-epg)
;;; pgg-epg.el ends here