2024-11-11 01:54:24 -08:00
|
|
|
% layout 'default';
|
|
|
|
% title 'Lookup';
|
|
|
|
<h1>Welcome to jjakke's keyserver!</h1>
|
|
|
|
<p><a href="/">index</a></p>
|
|
|
|
<h2>Search results:</h2>
|
|
|
|
% for my $item (@{ $c->stash('mydata') }) {
|
|
|
|
% my $pubkey_fpr = 0;
|
|
|
|
% my $string;
|
|
|
|
% my @row = split /\n/, $item;
|
|
|
|
<pre class="blob">
|
|
|
|
<%
|
2024-11-11 10:20:19 -08:00
|
|
|
my %sigcls = (
|
|
|
|
'10x' => 'self sig',
|
|
|
|
'11x' => 'self sig',
|
|
|
|
'12x' => 'self sig',
|
|
|
|
'13x' => 'self sig',
|
|
|
|
'18x' => 'subkey bind',
|
|
|
|
'19x' => 'primary key bind',
|
|
|
|
'20x' => 'revocation sig',
|
|
|
|
'28x' => 'subkey revocation sig',
|
|
|
|
'30x' => 'cert revocation sig',
|
2024-11-11 10:21:05 -08:00
|
|
|
);
|
2024-11-11 01:54:24 -08:00
|
|
|
for my $row (@row) {
|
|
|
|
my @data = split /:/, $row;
|
|
|
|
my $record = $data[0];
|
|
|
|
my $flag = $data[1];
|
|
|
|
my $keylen = $data[2];
|
|
|
|
my $algo = $data[3];
|
|
|
|
my $keyid = $data[4];
|
|
|
|
my $create = $data[5];
|
|
|
|
my $expire = $data[6];
|
|
|
|
my $userid = $data[9];
|
|
|
|
my $signatureclass = $data[10];
|
|
|
|
|
|
|
|
if ($record eq 'pub') {
|
|
|
|
if ($expire) {
|
|
|
|
$string .= "public key: " . gmtime($create) . " -> " . ( $expire ? gmtime($expire) : 'n/a' ) . " | flags: $flag\n"
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$string .= "public key: <span class=\"date\">" . gmtime($create) . " -> " . ( $expire ? gmtime($expire) : 'n/a' ) . "</span> | flags: $flag\n"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elsif ($record eq 'fpr') {
|
|
|
|
if (not $pubkey_fpr) {
|
|
|
|
$string .= "fingerprint: <a href=\"/pks/lookup?op=get&search=$userid\">$userid</a>\n";
|
|
|
|
$pubkey_fpr = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$string .= "<span class=\"fingerprint\">fingerprint: $userid</span>\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elsif ($record eq 'uid') {
|
|
|
|
my $safe = $userid;
|
|
|
|
$safe =~ s/>/>/g if $safe;
|
|
|
|
$safe =~ s/</</g if $safe;
|
|
|
|
$string .= "\n<strong>$safe</strong>\n" if $safe;
|
|
|
|
}
|
|
|
|
elsif ($record eq 'sig') {
|
2024-11-11 10:20:19 -08:00
|
|
|
$string .= "signature: $keyid | <span class=\"date\">" . gmtime($create) . " -> ". ( $expire ? gmtime($expire) : 'n/a' ) . "</span> | ";
|
|
|
|
(exists $sigcls{$signatureclass})
|
|
|
|
? ($string .= $sigcls{$signatureclass})
|
|
|
|
: ($string .= $signatureclass);
|
|
|
|
$string .= "\n";
|
2024-11-11 01:54:24 -08:00
|
|
|
}
|
|
|
|
elsif ($record eq 'sub') {
|
|
|
|
$string .= "\nsub key: " . gmtime($create) . " -> " . ( $expire ? gmtime($expire) : 'n/a' ) . " | flags: $flag\n"
|
|
|
|
}
|
|
|
|
elsif ($record eq 'rev') {
|
2024-11-11 10:20:19 -08:00
|
|
|
$string .= "<span class=\"highlight\">revocation: $keyid </span>| <span class=\"date\">" . gmtime($create) . "</span> | "
|
|
|
|
(exists $sigcls{$signatureclass})
|
|
|
|
? ($string .= $sigcls{$signatureclass})
|
|
|
|
: ($string .= $signatureclass);
|
|
|
|
$string .= "\n";
|
2024-11-11 01:54:24 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
%== $string
|
|
|
|
</pre>
|
|
|
|
<%
|
|
|
|
}
|
|
|
|
#rev:::1:95660BB822BAC934:1388248001:::::[selfsig]::20x:
|
|
|
|
|
|
|
|
#pub:u:255:22:9904E01052985080:1730221618:1856365618::u:,4
|
|
|
|
#fpr:::::::::50B750CC829A462D016AD9679904E01052985080:
|
|
|
|
#uid:::::::::Jake Thoughts (jjakke) <jake@jjakke.com>:
|
|
|
|
#sig:::22:9904E01052985080:1730221618:::::[selfsig]::13x:
|
|
|
|
#sub:u:255:18:190FCA50206CE28A:1730221618:1856365618:::
|
|
|
|
#fpr:::::::::B99D79A47141D942494EBCF2190FCA50206CE28A:
|
|
|
|
#sig:::22:9904E01052985080:1730221618:::::[keybind]::18x:
|
|
|
|
%>
|