1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: get_gpg_keys.coretag,v 1.5 2007-03-30 23:40:54 pajamian Exp $
10 UserTag get-gpg-keys Order dir
11 UserTag get-gpg-keys addAttr
12 UserTag get-gpg-keys Version $Revision: 1.5 $
13 UserTag get-gpg-keys Routine <<EOR
16 my $gpgexe = $Global::Variable->{GPG_PATH} || 'gpg';
18 my $flags = "--list-keys";
20 $dir = filter_value('filesafe', $dir);
21 $flags .= "--homedir $dir";
23 #::logDebug("gpg_get_keys flags=$flags");
25 open(GPGIMP, "$gpgexe $flags |")
26 or die "Can't fork: $!";
28 my $fmt = $opt->{long} ? "%s=%s (date %s, id %s)" : "%s=%s";
32 next unless s/^pub\s+//;
33 my ($id, $date, $text) = split /\s+/, $_, 3;
35 $text = ::errmsg( $fmt, $id, $text, $date, $id );
42 my $joiner = $opt->{joiner} || ",\n";
43 unshift @out, "=none" if $opt->{none};
44 return join($joiner, @out);