<h1>
  <% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_API_ISSUER_LIST_TITLE') %>
</h1>
<p>
  <% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_API_ISSUER_LIST_DESCRIPTION') %>
</p>
<table id="table_list">
  <tr>
    <th><% i18nGettext('I18N_OPENXPKI_CA_ID') %></th>
    <th><% i18nGettext('I18N_OPENXPKI_CA_STATUS') %></th>
    <th><% i18nGettext('I18N_OPENXPKI_CERT_NOTBEFORE') %></th>
    <th><% i18nGettext('I18N_OPENXPKI_CERT_NOTAFTER') %></th>
    <th><% i18nGettext('I18N_OPENXPKI_CA_CHAIN') %></th>
  </tr>
<%perl>
  foreach my $ca (sort keys %{$list})
  {
    print "  <tr>\n";
    print "    <td>\n";
</%perl>
        <& /lib/html/a.mhtml,
           'target' => "ca_cert_info.html",
           'params' => [["identifier", $list->{$ca}->{'identifier'}]],
           'label'  => $ca &>
<%perl>
    print "    </td>\n";
    print "    <td>\n";
    if ($list->{$ca}->{'status'})
    {
        print "      ".i18nGettext('I18N_OPENXPKI_CA_STATUS_USABLE')."\n";
    } else {
        print "      ".i18nGettext('I18N_OPENXPKI_CA_STATUS_UNUSABLE')."\n";
    }
    print "    </td>\n";
    print "    <td>\n";
    print "      ".join (" ", split "T", $list->{$ca}->{'notbefore'})." UTC\n";
    print "    </td>\n";
    print "    <td>\n";
    print "      ".join (" ", split "T", $list->{$ca}->{'notafter'})." UTC\n";
    print "    </td>\n";
    print "    <td>\n";
</%perl>
        <& /lib/html/a.mhtml,
           'target' => "chain_list.html",
           'params' => [["identifier", $list->{$ca}->{'identifier'}]],
           'label'  => $ca &>
<%perl>
    print "    </td>\n";
  }
</%perl>
</table>
<%init>
  my $msg  = $context->{client}->send_receive_command_msg ("get_ca_list");
  my $list = $msg->{PARAMS};
</%init>
