From: ueno Date: Thu, 13 Apr 2006 06:22:29 +0000 (+0000) Subject: * epg.el (epg-cipher-algorithm-alist): New constant. X-Git-Tag: epgsm-branchpoint~88 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=564ad4ae9acdf84d2148c196bbbc9ac5b06586f5;p=elisp%2Fepg.git * epg.el (epg-cipher-algorithm-alist): New constant. (epg-pubkey-algorithm-alist): New constant. (epg-digest-algorithm-alist): New constant. (epg-compress-algorithm-alist): New constant. (epg-configuration): New function. --- diff --git a/ChangeLog b/ChangeLog index b89a3f0..173735e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2006-04-13 Daiki Ueno + * epg.el (epg-cipher-algorithm-alist): New constant. + (epg-pubkey-algorithm-alist): New constant. + (epg-digest-algorithm-alist): New constant. + (epg-compress-algorithm-alist): New constant. + (epg-configuration): New function. + +2006-04-13 Daiki Ueno + * epg.el (epg-make-data-from-file): New function. (epg-make-data-from-string): New function. (epg-data-file): New function. diff --git a/epg.el b/epg.el index 5dc04d6..a775f54 100644 --- a/epg.el +++ b/epg.el @@ -85,6 +85,40 @@ This is used by `epg-list-keys'.") "The schema of keylisting output whose type is \"uid\". This is used by `epg-list-keys'.") +(defconst epg-cipher-algorithm-alist + '((0 . "NONE") + (1 . "IDEA") + (2 . "3DES") + (3 . "CAST5") + (4 . "BLOWFISH") + (7 . "AES") + (8 . "AES192") + (9 . "AES256") + (10 . "TWOFISH") + (110 . "DUMMY"))) + +(defconst epg-pubkey-algorithm-alist + '((1 . "RSA") + (2 . "RSA_E") + (3 . "RSA_S") + (16 . "ELGAMAL_E") + (17 . "DSA") + (20 . "ELGAMAL"))) + +(defconst epg-digest-algorithm-alist + '((1 . "MD5") + (2 . "SHA1") + (3 . "RMD160") + (8 . "SHA256") + (9 . "SHA384") + (10 . "SHA512"))) + +(defconst epg-compress-algorithm-alist + '((0 . "NONE") + (1 . "ZIP") + (2 . "ZLIB") + (3 . "BZIP2"))) + (defvar epg-prompt-alist nil) (defun epg-make-data-from-file (file) @@ -548,6 +582,26 @@ This function is for internal use only." (defun epg-progress-callback-function (what char current total handback) (message "%s: %d%%/%d%%" what current total)) +(defun epg-configuration () + "Return a list of internal configuration parameters of `epg-gpg-program'." + (let (configuration type) + (with-temp-buffer + (apply #'call-process epg-gpg-program nil (list t nil) nil + '("--with-colons" "--list-config")) + (goto-char (point-min)) + (while (re-search-forward "^cfg:\\([^:]+\\):\\(.*\\)" nil t) + (setq type (intern (match-string 1)) + config (cons (cons type + (if (memq type + '(pubkey cipher digest compress)) + (mapcar #'string-to-number + (delete "" (split-string + (match-string 2) + ";"))) + (match-string 2))) + config)))) + config)) + (defun epg-list-keys (name &optional secret) "List keys associated with STRING." (let ((args (list "--with-colons" "--no-greeting" "--batch" @@ -558,7 +612,7 @@ This function is for internal use only." (with-temp-buffer (apply #'call-process epg-gpg-program nil (list t nil) nil args) (goto-char (point-min)) - (while (looking-at "\\([a-z][a-z][a-z]\\):\\(.*\\)") + (while (re-search-forward "^\\([a-z][a-z][a-z]\\):\\(.*\\)" nil t) (setq type (match-string 1) symbol (intern-soft (format "epg-colons-%s-spec" type))) (if (member type '("pub" "sec"))