On Tue, Jan 16, 2001 at 01:19:13PM +0100, Kai Weber wrote:
> Hi,
>
> maybe it is not a question for Mutt but because I mostly use gpg with
> Mutt it fits the on-topic-rules.
>
> How can I automatically clean up my pubring? Let's say, a key has
> expired. Mutt/Gpg uses still the key in the pubring. I have to go and
> remove the key to fetch a new one.
>
> This is just an example. My question therefor is whether a solution for
> keeping the keyring up-to-date already exist?
This might not be exactly what you're looking for, but I've written a
short perl script called 'uk' (update-key(s)) which might help you out
a little.
uk <user/adress match>, like:
[huber@majere:~]-$> uk huber
2000-01-20 Josh Huber <[EMAIL PROTECTED]>
***************************************
Updating the listed keys from pgp.ai.mit.edu
***************************************
gpg: requesting key 6B21489A from pgp.ai.mit.edu ...
gpg: key 6B21489A: not changed
gpg: Total number processed: 1
gpg: unchanged: 1
if you don't enter a pattern to match, all the keys in your keyring
will be updated.
Then, I've got fk (find key), which could use some work:
#!/bin/sh
lynx -dump "http://pgp.ai.mit.edu:11371/pks/lookup?op=index&search=$1"
| grep ^pub | perl -e 'while(<>) { m/.*\](.*?) \S+ (.*)</; print $1,
", ", $2, "\n"; }'
example:
[huber@majere:~/bin]-$> fk [EMAIL PROTECTED]
6B21489A, Josh Huber
uk is attached.
--
Josh Huber | [EMAIL PROTECTED] |
1024D/6B21489A 61F0 6138 BE7B FEBF A223 E9D1 BFE1 2065 6B21 489A
#!/usr/bin/perl
my $keyserver = "pgp.ai.mit.edu";
my $name;
$name = $ARGV[0] unless scalar @ARGV == 0;
open(GPG, "gpg --list-keys |");
my $keystr;
my $num = 0;
my @keys;
while(<GPG>) {
chop;
if (m/^pub.*?\/(.+?)\s(.*$name.*)$/i) {
print $2,"\n";
$num++;
push @keys, $1;
}
}
$keystr = join ' ', @keys;
close(GPG);
if ($num == 0) {
print "No keys to get!\n";
exit 0;
}
print "\n***************************************\n";
print "Updating the listed keys from $keyserver\n";
print "***************************************\n\n";
`gpg --keyserver $keyserver --recv-key $keystr`;
PGP signature