<% 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' => [["ca_id", $item->{LABEL}], ["filename", $item->{FILENAME}], ["format", $format]], 'label' => $format &> <% $item->{NUMBER} %> <% $item->{LAST_UPDATE} %> <% $item->{NEXT_UPDATE} %> <% $item->{ENTRIES} %>
<%init> my $msg = $context->{client}->send_receive_command_msg ("get_ca_list"); my @list = (); foreach my $ca (sort keys %{$msg->{PARAMS}}) { next if (not $msg->{PARAMS}->{$ca}->{crl_publication}); foreach my $crl (@{$msg->{PARAMS}->{$ca}->{crl_files}}) { my $crl_msg = $context->{client}->send_receive_command_msg( 'get_crl', { 'CA_ID' => $ca, 'FILENAME' => $crl->{FILENAME}, 'FORMAT' => 'HASH', }, ); my $issuer = $crl_msg->{PARAMS}->{BODY}->{ISSUER}; # make issuer better breakable $issuer =~ s/,/, /g; my $last_update; if (exists $crl_msg->{PARAMS}->{BODY}->{LAST_UPDATE}) { $last_update = $crl_msg->{PARAMS}->{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_msg->{PARAMS}->{BODY}->{NEXT_UPDATE}) { $next_update = $crl_msg->{PARAMS}->{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, { 'LABEL' => $ca, 'FILENAME' => $crl->{FILENAME}, 'ISSUER' => $issuer, 'NUMBER' => $crl_msg->{PARAMS}->{BODY}->{SERIAL}, 'LAST_UPDATE' => $last_update, 'NEXT_UPDATE' => $next_update, 'ENTRIES' => ref $crl_msg->{PARAMS}->{LIST} eq 'ARRAY' ? scalar @{ $crl_msg->{PARAMS}->{LIST} } : '-', }; } } } <%once> use DateTime;