keyserver/templates/pkslookup.html.ep
2024-11-11 04:54:24 -05:00

71 lines
2.3 KiB
Text

% 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">
<%
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/>/&gt;/g if $safe;
$safe =~ s/</&lt;/g if $safe;
$string .= "\n<strong>$safe</strong>\n" if $safe;
}
elsif ($record eq 'sig') {
$string .= "signature: $keyid | <span class=\"date\">" . gmtime($create) . " -> ". ( $expire ? gmtime($expire) : 'n/a' ) . "</span> | $signatureclass\n";
}
elsif ($record eq 'sub') {
$string .= "\nsub key: " . gmtime($create) . " -> " . ( $expire ? gmtime($expire) : 'n/a' ) . " | flags: $flag\n"
}
elsif ($record eq 'rev') {
$string .= "<span class=\"highlight\">revocation: $keyid </span>| <span class=\"date\">" . gmtime($create) . "</span> | $signatureclass \n";
}
}
%>
%== $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:
%>