updating gpg keys

Derek D. Martin ddm at pizzashack.org
Wed Oct 9 13:17:31 EDT 2002


At one point, quite possibly at the BLU keysigning, someone mentioned
that it would be useful to have a script that would automatically
update the keys on your keyring.  The purpose of doing so is to obtain
the latest signatures on keys that you have, and widen your ring of
trust.  I just hacked up a little perl script to do this.  You could
add it to your crontab to make sure it's done automatically for you,
every so often...

I provide it here in the hope that it will be useful to someone.  =8^)
You could also do the same thing with --send-key, if your keys are
changing often enough through means other than downloading them via
keyservers...  Not sure how useful that would be though, so I didn't
bother to include it in the script.


-- 
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D

-------------- next part --------------
#!/usr/bin/perl

my $key_id;
my $gpg = "/usr/bin/gpg";
my $keysv = "--keyserver pgp.mit.edu";

open(GETGPGKEYS, "$gpg --list-keys|");

while (<GETGPGKEYS>){

	if (/^pub/){
		s!^.*[0-9]{3,4}[dDgGR]/([0-9A-F]*) .*!0x$1!;
		system("$gpg $keysv --recv-key $_");
	}
}



More information about the Discuss mailing list