yast/yast-registration

View on GitHub
src/data/registration/certificate_summary.erb

Summary

Maintainability
Test Coverage
<%
textdomain "registration"
%>
<h4><%= _("Issued To") %></h4>
<blockquote>
  <p>
    <b><%= _("Common Name (CN): ") %></b><%= h(certificate.subject_name) %><br>
    <b><%= _("Organization (O): ") %></b><%= h(certificate.subject_organization) %><br>
    <b><%= _("Organization Unit (OU): ") %></b><%= h(certificate.subject_organization_unit) %>
  </p>
</blockquote>

<h4><%= _("Issued By") %></h4>
<blockquote>
  <p>
    <b><%= _("Common Name (CN): ") %></b><%= h(certificate.issuer_name) %><br>
    <b><%= _("Organization (O): ") %></b><%= h(certificate.issuer_organization) %><br>
    <b><%= _("Organization Unit (OU): ") %></b><%= h(certificate.issuer_organization_unit) %>
  </p>
</blockquote>

<h4><%= _("Validity") %></h4>
<blockquote>
  <p>
    <%# label followed by the certificate issue date %>
    <b><%= _("Issued On: ") %></b><%= h(certificate.issued_on) %><br>
    <% if !certificate.valid_yet? %>
      <%# warning added after the certificate issue date if the certificate is not valid yet %>
      <b><font color="red"><%= _("WARNING: The certificate is not valid yet!") %></font></b><br>
    <% end %>
    <%# label followed by the certificate expiration date %>
    <b><%= _("Expires On: ") %></b><%= h(certificate.expires_on) %><br>
    <% if certificate.expired? %>
      <%# warning added after the certificate expiration date if the certificate has expired %>
      <b><font color="red"><%= _("WARNING: The certificate has expired!") %></font></b>
    <% end %>
  </p>
</p>
</blockquote>

<p>
  <%# label followed by the certificate serial number (in HEX format, e.g. AB:CD:42:FF...) %>
  <b><%= _("Serial Number: ") %></b><%= h(certificate.serial) %><br>
  <b><%= _("SHA1 Fingerprint: ") %></b>
  <%= h(certificate.fingerprint(::Registration::Fingerprint::SHA1).value) %><br>
  <b><%= _("SHA256 Fingerprint: ") %></b>
  <%= h(certificate.fingerprint(::Registration::Fingerprint::SHA256).value) %>
</p>