(if key
(list key))))))
+;;;###autoload
(defun epa-select-keys (context prompt &optional names secret)
"Display a user's keyring and ask him to select keys.
CONTEXT is an epg-context.
(epa-show-key (widget-get widget :value)))
(defun epa-mark (&optional arg)
- "Mark the current line."
+ "Mark the current line.
+If ARG is non-nil, unmark the current line."
(interactive "P")
(let ((inhibit-read-only t)
buffer-read-only
(forward-line)))
(defun epa-unmark (&optional arg)
- "Unmark the current line."
+ "Unmark the current line.
+If ARG is non-nil, mark the current line."
(interactive "P")
(epa-mark (not arg)))
(defun epa-exit-buffer ()
+ "Exit the current buffer.
+`epa-exit-buffer-function' is called if it is set."
(interactive)
(funcall epa-exit-buffer-function))
+;;;###autoload
(defun epa-decrypt-file (file)
+ "Decrypt FILE."
(interactive "fFile: ")
(let* ((default-name (file-name-sans-extension file))
(plain (expand-file-name
(epg-decrypt-file context file plain)
(message "Decrypting %s...done" (file-name-nondirectory file))))
+;;;###autoload
(defun epa-verify-file (file)
+ "Verify FILE."
(interactive "fFile: ")
(let* ((context (epg-make-context))
(plain (if (equal (file-name-extension file) "sig")
(epg-verify-result-to-string
(epg-context-result-for context 'verify)))))
+;;;###autoload
(defun epa-sign-file (file signers detached)
+ "Sign FILE by selected SIGNERS keys.
+If DETACHED is non-nil, it creates a detached signature."
(interactive
(list (expand-file-name (read-file-name "File: "))
(epa-select-keys (epg-make-context) "Select keys for signing.
(epg-sign-file context file signature (not (null detached)))
(message "Signing %s...done" (file-name-nondirectory file))))
+;;;###autoload
(defun epa-encrypt-file (file recipients)
+ "Encrypt FILE for RECIPIENTS."
(interactive
(list (expand-file-name (read-file-name "File: "))
(epa-select-keys (epg-make-context) "Select recipents for encryption.
(epg-encrypt-file context file recipients cipher)
(message "Encrypting %s...done" (file-name-nondirectory file))))
+;;;###autoload
(defun epa-delete-keys (keys)
+ "Delete selected KEYS."
(interactive
(let ((keys (epa-marked-keys)))
(unless keys
(apply #'epa-list-keys epa-list-keys-arguments)
(message "Deleting...done")))
+;;;###autoload
(defun epa-import-keys (file)
+ "Import keys from FILE."
(interactive "fFile: ")
(let ((context (epg-make-context)))
(message "Importing %s..." (file-name-nondirectory file))
(apply #'epa-list-keys epa-list-keys-arguments)
(message "Importing %s...done" (file-name-nondirectory file))))
+;;;###autoload
(defun epa-export-keys (keys file)
+ "Export selected KEYS to FILE."
(interactive
(let ((keys (epa-marked-keys))
default-name)
(epg-export-keys-to-file context keys file)
(message "Exporting to %s...done" (file-name-nondirectory file))))
+;;;###autoload
(defun epa-sign-keys (keys &optional local)
+ "Sign selected KEYS.
+If LOCAL is non-nil, the signature is marked as non exportable."
(interactive
(let ((keys (epa-marked-keys)))
(unless keys