From: ueno Date: Thu, 13 Apr 2006 09:12:48 +0000 (+0000) Subject: * epa.el: Added header. X-Git-Tag: epgsm-branchpoint~83 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=459c06006e20d5d2bad2d9aa37f7742bf18d45c1;p=elisp%2Fepg.git * epa.el: Added header. * epg.el (epg-list-keys): Specify --with-fingerprint. (epg-colons-fpr-spec): New variable. (epg-colons-pub-spec): Renamed trust -> validity and ownertrust -> owner-trust. (epg-colons-sec-spec): Ditto. (epg-colons-uid-spec): Renamed trust -> validity. --- diff --git a/ChangeLog b/ChangeLog index 9183968..83dcf23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2006-04-13 Daiki Ueno + * epa.el: Added header. + + * epg.el (epg-list-keys): Specify --with-fingerprint. + (epg-colons-fpr-spec): New variable. + (epg-colons-pub-spec): Renamed trust -> validity and ownertrust -> + owner-trust. + (epg-colons-sec-spec): Ditto. + (epg-colons-uid-spec): Renamed trust -> validity. + +2006-04-13 Daiki Ueno + * epa.el: New file. * epg.el (epg-cipher-algorithm-alist): New constant. diff --git a/epa.el b/epa.el index 73b867e..8e9e041 100644 --- a/epa.el +++ b/epa.el @@ -1,8 +1,33 @@ +;;; epa.el --- EasyPG Assistant, GUI of EasyPG +;; Copyright (C) 2006 Daiki Ueno + +;; Author: Daiki Ueno +;; Keywords: PGP, GnuPG + +;; This file is part of EasyPG. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + (require 'epg) (require 'font-lock) (defgroup epa nil - "EasyPG Assistant, GUI for EasyPG." + "EasyPG Assistant, GUI of EasyPG." :group 'epg) (defgroup epa-faces nil @@ -11,37 +36,37 @@ (defvar epa-buffer nil) -(defface epa-trust-full-face +(defface epa-validity-full-face '((((class color) (background dark)) (:foreground "PaleTurquoise" :bold t)) (t (:bold t))) - "Face used for displaying the trust-full addon." + "Face used for displaying the validity-full addon." :group 'epa-faces) -(defvar epa-trust-full-face 'epa-trust-full-face) +(defvar epa-validity-full-face 'epa-validity-full-face) -(defface epa-trust-disabled-face +(defface epa-validity-disabled-face '((((class color) (background dark)) (:foreground "PaleTurquoise" :italic t)) (t ())) - "Face used for displaying the disabled trust." + "Face used for displaying the disabled validity." :group 'epa-faces) -(defvar epa-trust-disabled-face 'epa-trust-disabled-face) +(defvar epa-validity-disabled-face 'epa-validity-disabled-face) -(defface epa-trust-unknown-face +(defface epa-validity-unknown-face '((t (:italic t))) - "Face used for displaying the trust-unknown addon." + "Face used for displaying the validity-unknown addon." :group 'epa-faces) -(defvar epa-trust-unknown-face 'epa-trust-unknown-face) +(defvar epa-validity-unknown-face 'epa-validity-unknown-face) -(defface epa-trust-marginal-face +(defface epa-validity-marginal-face '((t (:italic t :inverse-video t))) - "Face used for displaying the trust-marginal addon." + "Face used for displaying the validity-marginal addon." :group 'epa-faces) -(defvar epa-trust-marginal-face 'epa-trust-marginal-face) +(defvar epa-validity-marginal-face 'epa-validity-marginal-face) (defface epa-user-id-face '((((class color) @@ -57,18 +82,18 @@ (defvar epa-user-id-face 'epa-user-id-face) (defcustom epa-validity-face-alist - '((?o . epa-trust-unknown-face) - (?i . epa-trust-disabled-face) - (?d . epa-trust-disabled-face) - (?r . epa-trust-disabled-face) - (?e . epa-trust-disabled-face) - (?- . epa-trust-unknown-face) - (?q . epa-trust-unknown-face) - (?n . epa-trust-disabled-face) - (?m . epa-trust-marginal-face) - (?f . epa-trust-full-face) - (?u . epa-trust-full-face) - (? . epa-trust-full-face)) + '((?o . epa-validity-unknown-face) + (?i . epa-validity-disabled-face) + (?d . epa-validity-disabled-face) + (?r . epa-validity-disabled-face) + (?e . epa-validity-disabled-face) + (?- . epa-validity-unknown-face) + (?q . epa-validity-unknown-face) + (?n . epa-validity-disabled-face) + (?m . epa-validity-marginal-face) + (?f . epa-validity-full-face) + (?u . epa-validity-full-face) + (? . epa-validity-full-face)) "An alist mapping marks on epa-buffer to faces." :type 'list :group 'epa) @@ -96,7 +121,7 @@ keymap)) (defun epa-mode () - "Major mode for displaying addon list. + "Major mode for EasyPG Assistant. All normal editing commands are turned off." (kill-all-local-variables) (buffer-disable-undo) @@ -114,6 +139,7 @@ All normal editing commands are turned off." (run-hooks 'epa-mode-hook)) (defun epa () + "EasyPG Assistant." (interactive) (unless epa-buffer (setq epa-buffer (generate-new-buffer "*EPA*"))) @@ -186,7 +212,7 @@ All normal editing commands are turned off." (setq entry (cdr (assq 'pub (car pointer)))) (setq key-id (cdr (assq 'key-id entry))) (insert (format " %s %s %s\n" - (or (cdr (assq 'trust entry)) ? ) + (or (cdr (assq 'validity entry)) ? ) key-id (cdr (assq 'user-id (assq 'uid (car pointer)))))) (put-text-property point (point) 'epa-key-id key-id) @@ -195,22 +221,22 @@ All normal editing commands are turned off." (pop-to-buffer (current-buffer)) (delete-other-windows))) -(defun epa-key-id () - (let ((key-id (get-text-property (point) 'epa-key-id)) - point) +(defun epa-key-id (point) + (let ((key-id (get-text-property point 'epa-key-id))) (unless key-id - (setq point (next-single-property-change (point) 'epa-key-id)) + (setq point (next-single-property-change point 'epa-key-id)) (when point (goto-char point) - (setq key-id (get-text-property (point) 'epa-key-id)))) + (setq key-id (get-text-property point 'epa-key-id)))) key-id)) (defun epa-command-mark-key (key-id) + "Mark a key on the current line." (interactive (progn (unless (eq major-mode 'epa-mode) (error "Not in `epa-mode'")) - (list (epa-key-id)))) + (list (epa-key-id (point))))) (let ((point (point)) (inhibit-read-only t) buffer-read-only) @@ -228,11 +254,12 @@ All normal editing commands are turned off." (forward-line))) (defun epa-command-unmark-key (key-id) + "Unmark a key on the current line." (interactive (progn (unless (eq major-mode 'epa-mode) (error "Not in `epa-mode'")) - (list (epa-key-id)))) + (list (epa-key-id (point))))) (let ((point (point)) (inhibit-read-only t) buffer-read-only) @@ -250,6 +277,8 @@ All normal editing commands are turned off." (forward-line))) (defun epa-command-next-line (count) + "Same as next-line except that if you are at the beginning of buffer, +you will be jumped to the first secret key." (interactive "p") (if (get-text-property (point) 'epa-key-id) (next-line count) @@ -259,6 +288,7 @@ All normal editing commands are turned off." (goto-char point))))) (defun epa-command-encrypt-file (plain cipher recipients sign) + "Encrypt a file PLAIN for RECIPIENTS." (interactive (save-excursion (set-buffer epa-buffer) @@ -285,6 +315,7 @@ All normal editing commands are turned off." (message "Encrypting %s...done" (file-name-nondirectory plain))) (defun epa-command-sign-file (plain signature detached signers) + "Sign a file PLAIN." (interactive (save-excursion (set-buffer epa-buffer) diff --git a/epf.el b/epf.el index 3dfbbcd..b554919 100644 --- a/epf.el +++ b/epf.el @@ -1,6 +1,4 @@ ;;; epf.el --- transparent file encryption utility -;; Copyright (C) 1999, 2000, 2002, 2003, 2004, -;; 2005, 2006 Free Software Foundation, Inc. ;; Copyright (C) 2006 Daiki Ueno ;; Author: Daiki Ueno diff --git a/epg.el b/epg.el index bcc09d0..605f0d1 100644 --- a/epg.el +++ b/epg.el @@ -46,34 +46,37 @@ (defvar epg-debug nil) (defvar epg-colons-pub-spec - '((trust "[^:]") + '((validity "[^:]") (length "[0-9]+" 0 string-to-number) (algorithm "[0-9]+" 0 string-to-number) (key-id "[^:]+") (creation-date "[0-9]+") (expiration-date "[0-9]+") nil - (ownertrust "[^:]") + (owner-trust "[^:]") nil nil - (capability "[escaESCA]*")) + (capability "[escaESCA]+")) "The schema of keylisting output whose type is \"pub\". This is used by `epg-list-keys'.") (defvar epg-colons-sec-spec - '((trust "[^:]") + '((validity "[^:]") (length "[0-9]+" 0 string-to-number) (algorithm "[0-9]+" 0 string-to-number) (key-id "[^:]+") (creation-date "[0-9]+") (expiration-date "[0-9]+") nil - (ownertrust "[^:]")) + (owner-trust "[^:]") + nil + nil + (capability "[escaESCA]+")) "The schema of keylisting output whose type is \"sec\". This is used by `epg-list-keys'.") (defvar epg-colons-uid-spec - '((trust "[^:]") + '((validity "[^:]") nil nil nil @@ -85,6 +88,19 @@ This is used by `epg-list-keys'.") "The schema of keylisting output whose type is \"uid\". This is used by `epg-list-keys'.") +(defvar epg-colons-fpr-spec + '(nil + nil + nil + nil + nil + nil + nil + nil + (fingerprint "[^:]+")) + "The schema of keylisting output whose type is \"fpr\". +This is used by `epg-list-keys'.") + (defconst epg-cipher-algorithm-alist '((0 . "NONE") (1 . "IDEA") @@ -604,7 +620,7 @@ This function is for internal use only." (defun epg-list-keys (name &optional secret) "List keys associated with STRING." (let ((args (append (list "--with-colons" "--no-greeting" "--batch" - "--fixed-list-mode" + "--fixed-list-mode" "--with-fingerprint" (if secret "--list-secret-keys" "--list-keys")) (if name (list name)))) keys type symbol pointer)