<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_API_CRL_LIST_TITLE') %>

<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_API_CRL_LIST_DESCRIPTION') %>

% foreach my $item (@list) % { % foreach my $format (qw( DER PEM TXT )) { % } % }
<% i18nGettext('I18N_OPENXPKI_CRL_ISSUER') %> <% i18nGettext('I18N_OPENXPKI_CRL_FORMAT') %> <% i18nGettext('I18N_OPENXPKI_CRL_NUMBER') %> <% i18nGettext('I18N_OPENXPKI_CRL_LAST_UPDATE') %> <% i18nGettext('I18N_OPENXPKI_CRL_NEXT_UPDATE') %> <% i18nGettext('I18N_OPENXPKI_CRL_ENTRIES') %>
<% $item->{ISSUER} %> <& /lib/html/a.mhtml, 'target' => "../../binary/get_crl.html", 'params' => [["serial", $item->{NUMBER}], ["format", $format]], 'label' => $format &> <% $item->{NUMBER} %> <% $item->{LAST_UPDATE} %> <% $item->{NEXT_UPDATE} %> <% $item->{ENTRIES} %>
<%init> my $msg = $context->{client}->send_receive_command_msg ("get_crl_list", { FORMAT => 'HASH'}); my @list = (); foreach my $crl ( @{$msg->{PARAMS}} ) { my $issuer = $crl->{BODY}->{ISSUER}; # make issuer better breakable $issuer =~ s/,/, /g; my $last_update; if (exists $crl->{BODY}->{LAST_UPDATE}) { $last_update = $crl->{BODY}->{LAST_UPDATE}; my $dt = DateTime->from_epoch(epoch => $last_update); $last_update = $dt->strftime("%Y-%m-%d %H:%M:%S UTC"); } my $next_update; if (exists $crl->{BODY}->{NEXT_UPDATE}) { $next_update = $crl->{BODY}->{NEXT_UPDATE}; my $dt = DateTime->from_epoch(epoch => $next_update); $next_update = $dt->strftime("%Y-%m-%d %H:%M:%S UTC"); } if (defined $last_update) { push @list, { 'ISSUER' => $issuer, 'NUMBER' => $crl->{BODY}->{SERIAL}, 'LAST_UPDATE' => $last_update, 'NEXT_UPDATE' => $next_update, 'ENTRIES' => ref $crl->{LIST} eq 'ARRAY' ? scalar @{ $crl->{LIST} } : '-', }; } } <%once> use DateTime; use Data::Dumper;