Gnus development mailing list
 help / color / mirror / Atom feed
From: Michael Piotrowski <mxp@dynalabs.de>
To: ding@gnus.org
Subject: Re: epg and expired recipient keys
Date: Tue, 27 Feb 2007 12:23:23 +0100	[thread overview]
Message-ID: <x6zm6zc09g.fsf@eurus.mag.dynalabs.de> (raw)
In-Reply-To: <87zm71f0sl.fsf@wheatstone.g10code.de>

[-- Attachment #1: Type: text/plain, Size: 795 bytes --]

On 2007-02-26, Werner Koch <wk@gnupg.org> wrote:

>> I'm now wondering whether to exclude unusable keys from the key list
>
> Yes, please do this when encrypting.

I'm using the attached patch to epg.el to filter unusable keys.  I'm
checking for keys marked d, i, r, or e in `epg--list-keys-1'.  If you
want to browse unusable keys in `epa-list-keys' the filtering would
have to be implemented somewhere else, so maybe this is not the final
solution.  But it works for me and allows me to send encrypted
messages to people for whom there also expired keys in my keyring.
So, maybe it can be used as an example for a more comprehensive
implementation.

Greetings

-- 
Michael Piotrowski, M.A.                               <mxp@dynalabs.de>
Public key at <http://www.dynalabs.de/mxp/pubkey.txt>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Filter unusable keys --]
[-- Type: text/x-patch, Size: 1497 bytes --]

Index: epg.el
===================================================================
RCS file: /cvs/root/epg/epg.el,v
retrieving revision 1.188
diff -C2 -r1.188 epg.el
*** epg.el	31 Jan 2007 03:27:46 -0000	1.188
--- epg.el	27 Feb 2007 11:14:01 -0000
***************
*** 1656,1660 ****
  			'("--fixed-list-mode"))
  		      (if name (list name))))
! 	keys string field index)
      (with-temp-buffer
        (apply #'call-process
--- 1656,1660 ----
  			'("--fixed-list-mode"))
  		      (if name (list name))))
! 	keys)
      (with-temp-buffer
        (apply #'call-process
***************
*** 1664,1677 ****
  	     nil (list t nil) nil args)
        (goto-char (point-min))
!       (while (re-search-forward "^[a-z][a-z][a-z]:.*" nil t)
! 	(setq keys (cons (make-vector 15 nil) keys)
! 	      string (match-string 0)
! 	      index 0
! 	      field 0)
! 	(while (eq index
! 		   (string-match "\\([^:]+\\)?:" string index))
! 	  (setq index (match-end 0))
! 	  (aset (car keys) field (match-string 1 string))
! 	  (setq field (1+ field))))
        (nreverse keys))))
  
--- 1664,1676 ----
  	     nil (list t nil) nil args)
        (goto-char (point-min))
!       (let ((line 0))
! 	(while (not (eobp))
! 	  (goto-line (incf line))
! 	  (let ((fields (split-string (buffer-substring (point)
! 							(point-at-eol))
! 				      ":" nil)))
! 	    (when (cddr fields)
! 	      (unless (string-match "[dire]" (second fields))
! 		(push (apply 'vector fields) keys))))))
        (nreverse keys))))
  

  reply	other threads:[~2007-02-27 11:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-23 13:02 Michael Piotrowski
2007-02-24 16:00 ` Werner Koch
2007-02-26 10:37   ` Michael Piotrowski
     [not found]   ` <smutzxbtsam.fsf@linuxpal.mit.edu>
2007-02-26 12:23     ` Werner Koch
2007-02-26 12:49       ` Daiki Ueno
2007-02-26 14:31         ` Werner Koch
2007-02-27 11:23           ` Michael Piotrowski [this message]
2007-02-28 22:23           ` Daiki Ueno
2007-03-06  2:19             ` Wolfram Fenske
2007-03-06  4:29               ` Katsumi Yamaoka
2007-03-06  9:41                 ` Wolfram Fenske
2007-03-07 19:19                 ` Miles Bader
2007-03-07 19:25                   ` Miles Bader
2007-03-08  1:06                     ` dolist vs. while-loop (was Re: epg and expired recipient keys) Katsumi Yamaoka
2007-03-08 14:55                       ` Miles Bader
2007-03-06  4:40               ` epg and expired recipient keys Daiki Ueno
2007-03-06  9:37                 ` Wolfram Fenske

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x6zm6zc09g.fsf@eurus.mag.dynalabs.de \
    --to=mxp@dynalabs.de \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).