From b266fcffa03eb5436973e8e0ac194983e6b7a480 Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 19 Dec 2006 09:11:31 +0000 Subject: [PATCH] Use epa-protocol. --- epa.el | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/epa.el b/epa.el index 1dc4eda..90b7ddf 100644 --- a/epa.el +++ b/epa.el @@ -592,7 +592,7 @@ If SECRET is non-nil, list secret keys instead of public keys." ") ") (file-name-directory default-name) default-name))) - (context (epg-make-context))) + (context (epg-make-context epa-protocol))) (epg-context-set-passphrase-callback context #'epa-passphrase-callback-function) (epg-context-set-progress-callback context @@ -610,7 +610,7 @@ If SECRET is non-nil, list secret keys instead of public keys." "Verify FILE." (interactive "fFile: ") (setq file (expand-file-name file)) - (let* ((context (epg-make-context)) + (let* ((context (epg-make-context epa-protocol)) (plain (if (equal (file-name-extension file) "sig") (file-name-sans-extension file)))) (epg-context-set-progress-callback context @@ -627,7 +627,8 @@ If SECRET is non-nil, list secret keys instead of public keys." "Sign FILE by SIGNERS keys selected." (interactive (list (expand-file-name (read-file-name "File: ")) - (epa-select-keys (epg-make-context) "Select keys for signing. + (epa-select-keys (epg-make-context epa-protocol) + "Select keys for signing. If no one is selected, default secret key is used. " nil t) (catch 'done @@ -657,7 +658,7 @@ d - Create a detached signature (if (memq mode '(t detached)) ".sig" ".gpg")))) - (context (epg-make-context))) + (context (epg-make-context epa-protocol))) (epg-context-set-armor context epa-armor) (epg-context-set-textmode context epa-textmode) (epg-context-set-signers context signers) @@ -675,10 +676,11 @@ d - Create a detached signature "Encrypt FILE for RECIPIENTS." (interactive (list (expand-file-name (read-file-name "File: ")) - (epa-select-keys (epg-make-context) "Select recipients for encryption. + (epa-select-keys (epg-make-context epa-protocol) + "Select recipients for encryption. If no one is selected, symmetric encryption will be performed. "))) (let ((cipher (concat file (if epa-armor ".asc" ".gpg"))) - (context (epg-make-context))) + (context (epg-make-context epa-protocol))) (epg-context-set-armor context epa-armor) (epg-context-set-textmode context epa-textmode) (epg-context-set-passphrase-callback context @@ -697,7 +699,7 @@ If no one is selected, symmetric encryption will be performed. "))) Don't use this command in Lisp programs!" (interactive "r") (save-excursion - (let ((context (epg-make-context)) + (let ((context (epg-make-context epa-protocol)) plain) (epg-context-set-passphrase-callback context #'epa-passphrase-callback-function) @@ -747,7 +749,7 @@ Don't use this command in Lisp programs!" Don't use this command in Lisp programs!" (interactive "r") - (let ((context (epg-make-context))) + (let ((context (epg-make-context epa-protocol))) (epg-context-set-progress-callback context #'epa-progress-callback-function) (epg-verify-string context @@ -790,7 +792,8 @@ Don't use this command in Lisp programs!" Don't use this command in Lisp programs!" (interactive (list (region-beginning) (region-end) - (epa-select-keys (epg-make-context) "Select keys for signing. + (epa-select-keys (epg-make-context epa-protocol) + "Select keys for signing. If no one is selected, default secret key is used. " nil t) (catch 'done @@ -814,7 +817,7 @@ d - Create a detached signature (t (throw 'done nil)))))))) (save-excursion - (let ((context (epg-make-context)) + (let ((context (epg-make-context epa-protocol)) signature) ;;(epg-context-set-armor context epa-armor) (epg-context-set-armor context t) @@ -842,10 +845,11 @@ d - Create a detached signature Don't use this command in Lisp programs!" (interactive (list (region-beginning) (region-end) - (epa-select-keys (epg-make-context) "Select recipients for encryption. + (epa-select-keys (epg-make-context epa-protocol) + "Select recipients for encryption. If no one is selected, symmetric encryption will be performed. "))) (save-excursion - (let ((context (epg-make-context)) + (let ((context (epg-make-context epa-protocol)) cipher) ;;(epg-context-set-armor context epa-armor) (epg-context-set-armor context t) @@ -876,7 +880,7 @@ Don't use this command in Lisp programs!" (error "No keys selected")) (list keys (eq (nth 1 epa-list-keys-arguments) t)))) - (let ((context (epg-make-context))) + (let ((context (epg-make-context epa-protocol))) (message "Deleting...") (epg-delete-keys context keys allow-secret) (message "Deleting...done") @@ -889,7 +893,7 @@ Don't use this command in Lisp programs!" Don't use this command in Lisp programs!" (interactive "fFile: ") (setq file (expand-file-name file)) - (let ((context (epg-make-context))) + (let ((context (epg-make-context epa-protocol))) (message "Importing %s..." (file-name-nondirectory file)) (condition-case nil (progn @@ -909,7 +913,7 @@ Don't use this command in Lisp programs!" Don't use this command in Lisp programs!" (interactive "r") - (let ((context (epg-make-context))) + (let ((context (epg-make-context epa-protocol))) (message "Importing...") (condition-case nil (progn @@ -944,7 +948,7 @@ Don't use this command in Lisp programs!" ") ") (file-name-directory default-name) default-name))))) - (let ((context (epg-make-context))) + (let ((context (epg-make-context epa-protocol))) (epg-context-set-armor context epa-armor) (message "Exporting to %s..." (file-name-nondirectory file)) (epg-export-keys-to-file context keys file) @@ -956,8 +960,9 @@ Don't use this command in Lisp programs!" Don't use this command in Lisp programs!" (interactive - (list (epa-select-keys (epg-make-context) "Select keys to export. "))) - (let ((context (epg-make-context))) + (list (epa-select-keys (epg-make-context epa-protocol) + "Select keys to export. "))) + (let ((context (epg-make-context epa-protocol))) ;;(epg-context-set-armor context epa-armor) (epg-context-set-armor context t) (insert (epg-export-keys-to-string context keys)))) @@ -973,7 +978,7 @@ Don't use this command in Lisp programs!" (unless keys (error "No keys selected")) (list keys current-prefix-arg))) - (let ((context (epg-make-context))) + (let ((context (epg-make-context epa-protocol))) (epg-context-set-passphrase-callback context #'epa-passphrase-callback-function) (epg-context-set-progress-callback context -- 1.7.10.4