#!/usr/local/bin/perl # list_keys.cgi # Display all keys in your keyring require './gnupg-lib.pl'; &ui_print_header(undef, $text{'keys_title'}, ""); @keys = &list_keys(); print "$text{'keys_desc'}
\n";
# List of existing keys
print &ui_form_start("delete_keys.cgi", "post");
@links = ( &select_all_link("d"),
&select_invert_link("d") );
print &ui_links_row(\@links);
@tds = ( "width=5" );
print &ui_columns_start([ "",
$text{'keys_id'},
$text{'keys_secret'},
$text{'keys_date'},
$text{'keys_name'},
$text{'keys_email'} ], 100);
foreach $k (@keys) {
local @cols;
push(@cols, "$k->{'key'}");
push(@cols, $k->{'secret'} ? "$text{'yes'}"
: $text{'no'});
push(@cols, $k->{'date'});
push(@cols, join("
", map { &html_escape($_) } @{$k->{'name'}}));
push(@cols, join("
", map { &html_escape($_) } @{$k->{'email'}}));
if ($k->{'secret'}) {
# Cannot delete secret keys this way
print &ui_columns_row([ "", @cols ], \@tds);
}
else {
print &ui_checked_columns_row(\@cols, \@tds, "d",$k->{'index'});
}
}
print &ui_columns_end();
print &ui_links_row(\@links);
print &ui_form_end([ [ "delete", $text{'keys_delete'} ] ]);
# Form for adding a key
print "
\n"; print "
\n"; print "\n"; print "
\n"; &ui_print_footer("", $text{'index_return'});