Skip to content

Commit

Permalink
Showing the alias if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed May 24, 2021
1 parent 55687f3 commit 75b65b2
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 122 deletions.
Expand Up @@ -38,6 +38,7 @@
import com.helger.commons.http.EHttpMethod;
import com.helger.commons.id.factory.GlobalIDFactory;
import com.helger.commons.math.MathHelper;
import com.helger.commons.string.StringHelper;
import com.helger.css.property.CCSSProperties;
import com.helger.datetime.util.PDTDisplayHelper;
import com.helger.html.hc.IHCNode;
Expand Down Expand Up @@ -236,7 +237,8 @@ private static String _inGroupsOf (@Nonnull final String s, final int nChars)
}

@Nonnull
public static BootstrapTable createCertificateDetailsTable (@Nonnull final X509Certificate aX509Cert,
public static BootstrapTable createCertificateDetailsTable (@Nullable final String sAlias,
@Nonnull final X509Certificate aX509Cert,
@Nonnull final LocalDateTime aNowLDT,
@Nonnull final Locale aDisplayLocale)
{
Expand All @@ -246,6 +248,8 @@ public static BootstrapTable createCertificateDetailsTable (@Nonnull final X509C

final BootstrapTable aCertDetails = new BootstrapTable (new HCCol ().addStyle (CCSSProperties.WIDTH.newValue ("12rem")), HCCol.star ());
aCertDetails.setResponsive (true);
if (StringHelper.hasText (sAlias))
aCertDetails.addBodyRow ().addCell ("Alias:").addCell (sAlias);
aCertDetails.addBodyRow ().addCell ("Version:").addCell (Integer.toString (aX509Cert.getVersion ()));
aCertDetails.addBodyRow ().addCell ("Subject:").addCell (aX509Cert.getSubjectX500Principal ().getName ());
aCertDetails.addBodyRow ().addCell ("Issuer:").addCell (aX509Cert.getIssuerX500Principal ().getName ());
Expand Down

0 comments on commit 75b65b2

Please sign in to comment.