get-gpg-keys — lists GPG keys
Attribute | Pos. | Req. | Default | Description |
---|---|---|---|---|
dir | Yes | No | GPG home directory | |
long | include date and id in output | |||
joiner | ||||
none | ||||
interpolate | 0 | interpolate output? | ||
hide | 0 | Hide the tag return value? |
Interchange 5.9.0:
Source: code/UI_Tag/get_gpg_keys.coretag
Lines: 46
# Copyright 2002-2007 Interchange Development Group and others # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. See the LICENSE file for details. # # $Id: get_gpg_keys.coretag,v 1.5 2007-03-30 23:40:54 pajamian Exp $ UserTag get-gpg-keys Order dir UserTag get-gpg-keys addAttr UserTag get-gpg-keys Version $Revision: 1.5 $ UserTag get-gpg-keys Routine <<EOR sub { my ($dir, $opt) = @_; my $gpgexe = $Global::Variable->{GPG_PATH} || 'gpg'; my $flags = "--list-keys"; if($dir) { $dir = filter_value('filesafe', $dir); $flags .= "--homedir $dir"; } #::logDebug("gpg_get_keys flags=$flags"); open(GPGIMP, "$gpgexe $flags |") or die "Can't fork: $!"; my $fmt = $opt->{long} ? "%s=%s (date %s, id %s)" : "%s=%s"; my @out; while(<GPGIMP>) { next unless s/^pub\s+//; my ($id, $date, $text) = split /\s+/, $_, 3; $id =~ s:.*?/::; $text = ::errmsg( $fmt, $id, $text, $date, $id ); $text =~ s/</</g; $text =~ s/>/>/g; $text =~ s/,/,/g; push @out, $text; } close GPGIMP; my $joiner = $opt->{joiner} || ",\n"; unshift @out, "=none" if $opt->{none}; return join($joiner, @out); } EOR