key objects.
* epa-dired.el (epa-dired-do-encrypt): RECIPIENTS is now a list of
key objects.
* epa.el (epa-select-keys): Added MODE argument.
(epa-encrypt-file): RECIPIENTS is now a list of key objects.
* epg.el (epg-status-SIG_CREATED): New function.
(epg-start-sign): epg-context-signers is now a list of key objects.
(epg-start-encrypt): RECIPIENTS is now a list of key objects.
+2006-04-20 Daiki Ueno <ueno@unixuser.org>
+
+ * epa-file.el (epa-file-write-region): RECIPIENTS is now a list of
+ key objects.
+ * epa-dired.el (epa-dired-do-encrypt): RECIPIENTS is now a list of
+ key objects.
+
+ * epa.el (epa-select-keys): Added MODE argument.
+ (epa-encrypt-file): RECIPIENTS is now a list of key objects.
+
+ * epg.el (epg-status-SIG_CREATED): New function.
+ (epg-start-sign): epg-context-signers is now a list of key objects.
+ (epg-start-encrypt): RECIPIENTS is now a list of key objects.
+
2006-04-19 Daiki Ueno <ueno@unixuser.org>
* epa.el (epa-verify-file): Show results in minibuffer.
(while file-list
(epa-encrypt-file
(expand-file-name (car file-list))
- (mapcar (lambda (key)
- (epg-sub-key-id
- (car (epg-key-sub-key-list key))))
- (epa-select-keys "Select recipents for encryption.
-If no one is selected, symmetric encryption will be performed. ")))
+ (epa-select-keys "Select recipents for encryption.
+If no one is selected, symmetric encryption will be performed. "))
(setq file-list (cdr file-list)))
(revert-buffer)))
(encode-coding-string start coding-system)
(encode-coding-string (buffer-substring start end)
coding-system))
- (mapcar (lambda (key)
- (epg-sub-key-id (car (epg-key-sub-key-list key))))
- (unless (assoc file epa-file-passphrase-alist)
+ (unless (assoc file epa-file-passphrase-alist)
(epa-select-keys
"Select recipents for encryption.
-If no one is selected, symmetric encryption will be performed. ")))))
+If no one is selected, symmetric encryption will be performed. "))))
(error
(if (setq entry (assoc file epa-file-passphrase-alist))
(setcdr entry nil))
(beginning-of-line)
(get-text-property (point) 'epa-key))))
-(defun epa-select-keys (prompt &optional names)
+(defun epa-select-keys (prompt &optional names mode)
(save-excursion
(unless (and epa-keys-buffer
(buffer-live-p epa-keys-buffer))
(if names
(while names
(setq point (point))
- (epa-list-keys-1 (car names) nil)
+ (epa-list-keys-1 (car names) mode)
(goto-char point)
(epa-mark)
(goto-char (point-max))
(setq names (cdr names)))
- (epa-list-keys-1 nil nil))
+ (epa-list-keys-1 nil mode))
(epa-keys-mode)
(goto-char (point-min))
(pop-to-buffer (current-buffer))
(defun epa-encrypt-file (file recipients)
(interactive
(list (expand-file-name (read-file-name "File: "))
- (mapcar (lambda (key)
- (epg-sub-key-id
- (car (epg-key-sub-key-list key))))
- (epa-select-keys "Select recipents for encryption.
-If no one is selected, symmetric encryption will be performed. "))))
+ (epa-select-keys "Select recipents for encryption.
+If no one is selected, symmetric encryption will be performed. ")))
(let ((cipher (concat file ".gpg"))
(context (epg-make-context)))
(message "Encrypting %s..." (file-name-nondirectory file))
(cons (cons 'delete-problem (string-to-number (match-string 1 string)))
(epg-context-result-for epg-context 'error)))))
+(defun epg-status-SIG_CREATED (process string)
+ (if (string-match "\\`\\([DCS]\\) \\([0-9]+\\) \\([0-9]+\\) \
+\\([0-9A-Fa-F][0-9A-Fa-F]\\) \\(.*\\) " string)
+ (epg-context-set-result-for
+ epg-context 'sign
+ (cons (list (cons 'type (string-to-char (match-string 1 string)))
+ (cons 'pubkey-algorithm
+ (string-to-number (match-string 2 string)))
+ (cons 'digest-algorithm
+ (string-to-number (match-string 3 string)))
+ (cons 'class (string-to-number (match-string 4 string) 16))
+ (cons 'creation-time (match-string 5 string))
+ (cons 'fingerprint (substring string (match-end 0))))
+ (epg-context-result-for epg-context 'sign)))))
+
(defun epg-passphrase-callback-function (key-id handback)
(read-passwd
(if (eq key-id 'SYM)
"--detach-sign"
"--sign")))
(apply #'nconc
- (mapcar (lambda (signer)
- (list "-u" signer))
- (epg-context-signers context)))
+ (mapcar
+ (lambda (signer)
+ (list "-u"
+ (epg-sub-key-id
+ (car (epg-key-sub-key-list signer)))))
+ (epg-context-signers context)))
(if (epg-data-file plain)
(list (epg-data-file plain)))))
(epg-wait-for-status context '("BEGIN_SIGNING"))
(list "-u" signer))
(epg-context-signers context)))))
(apply #'nconc
- (mapcar (lambda (recipient)
- (list "-r" recipient))
- recipients))
+ (mapcar
+ (lambda (recipient)
+ (list "-r"
+ (epg-sub-key-id
+ (car (epg-key-sub-key-list recipient)))))
+ recipients))
(if (epg-data-file plain)
(list (epg-data-file plain)))))
(if sign