* Import keyanalyze into signing-party. Thanks to Matthew Wilcox for the
[pgp-tools.git] / keyanalyze / willy / party-table.pl
1 #!/usr/bin/perl
2
3 # Version: 1.0
4 # Date: 2001.01.07
5 # Author: V. Alex Brennen <vab@cryptnet.net>
6 # http://www.cryptnet.net/people/vab/
7 # License: GPL
8 # Description:
9 # This script was written as part of the gpg keysigning
10 # party howto. It generates a checklist for individuals
11 # participating in a keysigning party. The keysigning
12 # howto lives at:
13 # http://www.cryptnet.net/fdp/crypto/gpg-party.html
14
15 if($ARGV[0] eq "")
16 {
17 print "\nUsage: party-table.pl <keyring> > out_file.html\n";
18 print "\nThe keyring should be the keyring where the public keys for the\n";
19 print "party participants are stored.\n\n";
20 exit;
21 }
22
23 @fps = `gpg --fingerprint --no-default-keyring --keyring $ARGV[0]`;
24
25 my @parsed;
26
27 while($line = shift(@fps))
28 {
29 if($line =~ /^pub/)
30 {
31 $key_info = substr($line,5,14);
32 ($size_type,$id) = split(/\//,$key_info);
33 $size = substr($size_type,0,4);
34 $type = substr($size_type,-1,1);
35 $owner = substr($line,31,-1);
36 $fp_line = shift(@fps);
37 ($trash,$fp) = split(/ = /,$fp_line);
38 chomp $fp;
39 ($fp1,$fp2) = split(/ /,$fp);
40 $fp1 =~ s/ /&nbsp;/g;
41 $fp2 =~ s/ /&nbsp;/g;
42 if($type eq "D"){$type = "DSA";}
43 elsif($type eq "R"){$type = "RSA";}
44 elsif($type eq "G"){$type = "ElG";}
45 $owner =~ s/</&lt\;/;
46 $owner =~ s/>/&gt\;/;
47 $owner =~ s/@/-at-/;
48 push @parsed, {
49 id => $id,
50 owner => $owner,
51 fp1 => $fp1,
52 fp2 => $fp2,
53 size => $size,
54 type => $type,
55 };
56 }
57 }
58
59 print "<HTML>\n";
60 print "<TABLE BORDER=1>\n";
61 print "<TR><TD>Key ID</TD><TD>Key Owner</TD><TD>Key Fingerprint</TD><TD>Key Size</TD><TD>Key Type</TD><TD>Key Info Matches?</TD><TD>Owner ID Matches?</TD></TR>\n";
62
63 foreach my $f (sort {uc($a->{owner}) cmp uc($b->{owner})} @parsed)
64 {
65 $id = $f->{id};
66 $owner = $f->{owner};
67 $fp1 = $f->{fp1};
68 $fp2 = $f->{fp2};
69 $size = $f->{size};
70 $type = $f->{type};
71
72 print "<TR><TD>$id</TD><TD>$owner</TD><TD><tt>$fp1 $fp2</tt></TD><TD>$size</TD>";
73 print "<TD>$type</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>\n";
74 }
75
76 print "</TABLE>\n";
77 print "</HTML>";