<%args> $identifier => undef $revocation => undef

<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_API_CERT_INFO_TITLE', __SERIAL__ => $serial) %>

<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_API_CERT_INFO_DESCRIPTION') %>

% if ($status eq 'REVOKED') {

<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_API_CERT_INFO_REVOKED_DESC') %>

% } % elsif ($status eq 'SUSPENDED') {

<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_API_CERT_INFO_SUSPENDED_DESC') %>

% } % elsif ($status eq 'CRL_ISSUANCE_PENDING') {

<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_API_CERT_INFO_CRL_ISSUANCE_PENDING_DESC') %>

% } % }
<% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_TABLE_HEAD_NAME') %> <% i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_TABLE_HEAD_VALUE') %>
<% i18nGettext('I18N_OPENXPKI_CERT_SUBJECT') %> <% $subject %>
<% i18nGettext('I18N_OPENXPKI_CERT_FINGERPRINT') %> <% $fingerprint %>
<% i18nGettext('I18N_OPENXPKI_CERT_NOTBEFORE') %> <% join " ", split "T", $notbefore %> UTC % if ($not_yet_valid) { (<% i18nGettext('I18N_OPENXPKI_CERT_NOT_YET_VALID') %>) % }
<% i18nGettext('I18N_OPENXPKI_CERT_NOTAFTER') %> <% join " ", split "T", $notafter %> UTC % if ($expired) { (<% i18nGettext('I18N_OPENXPKI_CERT_EXPIRED') %>)
<% i18nGettext('I18N_OPENXPKI_CERT_ISSUER') %> <% $issuer %>

<& /lib/html/a.mhtml, target => 'cert_full_info.html', label => i18nGettext('I18N_OPENXPKI_CLIENT_HTML_MASON_FULL_CERT_INFO_LINK'), params => [["identifier", $identifier]] &>


<% i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_MOZILLA') %> <& /lib/html/a.mhtml, target => '../../binary/get_certificate.html', label => i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_USER_ENROLL'), params => [["identifier", $identifier], ["content_type", "X509_USER_CERT"], ["format", "PEM"]] &>
<& /lib/html/a.mhtml, target => '../../binary/get_certificate.html', label => i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_EMAIL_ENROLL_MOZILLA'), params => [["identifier", $identifier], ["content_type", "X509_EMAIL_CERT"], ["format", "PEM"]] &>
<% i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_INTERNET_EXPLORER') %> <& /lib/html/a.mhtml, target => 'cert_enroll_ie.html', label => i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_IE_ENROLL'), params => [["identifier", $identifier]] &>
<& /lib/html/a.mhtml, target => '../../binary/get_certificate.crt', label => i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_EMAIL_ENROLL'), params => [["identifier", $identifier], ["content_type", "IE_USER"], ["format", "PEM"]] &>

<% i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_PEM') %> <& /lib/html/a.mhtml, target => '../../binary/get_certificate.html', label => i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD'), params => [["identifier", $identifier], ["content_type", "PLAIN"], ["format", "PEM"]] &>
<% i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_DER') %> <& /lib/html/a.mhtml, target => '../../binary/get_certificate.crt', label => i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD'), params => [["identifier", $identifier], ["content_type", "DOWNLOAD"], ["format", "DER"]] &>
<% i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_TXT') %> <& /lib/html/a.mhtml, target => '../../binary/get_certificate.html', label => i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD'), params => [["identifier", $identifier], ["content_type", "PLAIN"], ["format", "TXT"]] &>
% if ($private_key ne 'private_key_exists_for_cert' && % $private_key ne '') {

<% i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_PRIV_KEY_EXISTS') %>

<% i18nGettext('I18N_OPENXPKI_KEY_DOWNLOAD_PKCS8_PEM') %> <& /lib/html/a.mhtml, target => $context->{menu}->get_root() . '/service/api/get_privkey_password.html', label => i18nGettext('I18N_OPENXPKI_PRIVKEY_DOWNLOAD'), params => [["identifier", $identifier], ["format", "PKCS8_PEM"]] &>
<% i18nGettext('I18N_OPENXPKI_KEY_DOWNLOAD_PKCS8_DER') %> <& /lib/html/a.mhtml, target => $context->{menu}->get_root() . '/service/api/get_privkey_password.html', label => i18nGettext('I18N_OPENXPKI_PRIVKEY_DOWNLOAD'), params => [["identifier", $identifier], ["format", "PKCS8_DER"]] &>
<% i18nGettext('I18N_OPENXPKI_KEY_DOWNLOAD_OPENSSL_PRIVKEY') %> <& /lib/html/a.mhtml, target => $context->{menu}->get_root() . '/service/api/get_privkey_password.html', label => i18nGettext('I18N_OPENXPKI_PRIVKEY_DOWNLOAD'), params => [["identifier", $identifier], ["format", "OPENSSL_PRIVKEY"]] &>

<% i18nGettext('I18N_OPENXPKI_CERT_DOWNLOAD_PRIV_KEY_AND_CERTIFICATE') %>

% } % if ($revocation) { % }
<% i18nGettext('I18N_OPENXPKI_KEY_DOWNLOAD_PKCS12') %>  <& /lib/html/a.mhtml, target => $context->{menu}->get_root() . '/service/api/get_privkey_password.html', label => i18nGettext('I18N_OPENXPKI_PRIVKEY_AND_CERT_DOWNLOAD'), params => [["identifier", $identifier], ["format", "PKCS12"]] &>
<% i18nGettext('I18N_OPENXPKI_KEY_DOWNLOAD_JAVA_KEYSTORE') %> <& /lib/html/a.mhtml, target => $context->{menu}->get_root() . '/service/api/get_privkey_password.html', label => i18nGettext('I18N_OPENXPKI_PRIVKEY_AND_CERT_DOWNLOAD'), params => [["identifier", $identifier], ["format", "JAVA_KEYSTORE"]] &>
<& /lib/html/a.mhtml, target => $context->{menu}->get_root() . '/service/create_crr/form.html', label => i18nGettext('I18N_OPENXPKI_HTML_MASON_CERT_INFO_NEW_CRR'), params => [["cert_identifier", $identifier]], &>
<%init> my $msg = $context->{client}->send_receive_command_msg ( "get_cert", {'IDENTIFIER' => $identifier}); ## print Dumper($msg)."\n"; my $params = $msg->{PARAMS}->{BODY}; my $subject = $params->{SUBJECT}; my $notbefore = $params->{NOTBEFORE}; my $notafter = $params->{NOTAFTER}; my $issuer = $params->{ISSUER}; my $fingerprint = $params->{FINGERPRINT}; my $serial = $params->{SERIAL}; $serial .= ' (0x' . sprintf("%0x", $serial) . ')'; my $status = $msg->{PARAMS}->{STATUS}; my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = gmtime(time); $year += 1900; $mon++; my $now = sprintf("%04d-%02d-%02dT%02d:%02d%02d", $year, $mon, $mday, $hour, $min, $sec); my $not_yet_valid; my $expired; if ($now lt $notbefore) { $not_yet_valid = 1; } if ($now gt $notafter) { $expired = 1; } # retrieve CSR workflow and look for a private_key field my $p_msg = $context->{client}->send_receive_command_msg( 'private_key_exists_for_cert', { IDENTIFIER => $identifier, } ); my $private_key = $p_msg->{PARAMS};