Skip to content

Commit

Permalink
fix: Fixed Keypair validity display to link only the leaf [backport r…
Browse files Browse the repository at this point in the history
…elease-5.5.0] (#5303)

fix: Fixed Keypair validity display to link only the leaf (#5300)

* fix: Fixed Keypair validity display to link only the leaf

Signed-off-by: MMaiero <[email protected]>

* chore: Copyright date update

---------

Signed-off-by: MMaiero <[email protected]>
(cherry picked from commit ffcd90e)

Co-authored-by: Matteo Maiero <[email protected]>
  • Loading branch information
github-actions[bot] and MMaiero authored Jun 29, 2024
1 parent c30ff17 commit ed6915c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2023 Eurotech and/or its affiliates and others
* Copyright (c) 2011, 2024 Eurotech and/or its affiliates and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -163,7 +163,7 @@ public List<GwtKeystoreEntry> listEntries() throws GwtKuraException {
Certificate[] chain = pke.getCertificateChain();

if (chain.length > 0) {
Certificate leaf = chain[chain.length - 1];
Certificate leaf = chain[0];

if (leaf instanceof X509Certificate) {
validityStartDate = ((X509Certificate) leaf).getNotBefore();
Expand All @@ -178,7 +178,7 @@ public List<GwtKeystoreEntry> listEntries() throws GwtKuraException {
Certificate cert = chain[i];
if (cert instanceof X509Certificate) {
X509Certificate x509Cert = CertificateUtil.toJavaX509Certificate(cert);
distinguishedNames.add(index + x509Cert.getSubjectX500Principal().getName());
distinguishedNames.add(index + x509Cert.getSubjectX500Principal().toString());
}
}
}
Expand All @@ -192,7 +192,7 @@ public List<GwtKeystoreEntry> listEntries() throws GwtKuraException {
validityEndDate = ((X509Certificate) cert).getNotAfter();

X509Certificate x509Cert = CertificateUtil.toJavaX509Certificate(cert);
distinguishedNames.add(x509Cert.getSubjectX500Principal().getName());
distinguishedNames.add(x509Cert.getSubjectX500Principal().toString());
}
} else if (e.getValue() instanceof SecretKeyEntry) {
kind = Kind.SECRET_KEY;
Expand Down Expand Up @@ -243,4 +243,4 @@ public void removeEntry(GwtXSRFToken xsrfToken, GwtKeystoreEntry entry) throws G
}
}
}
}
}

0 comments on commit ed6915c

Please sign in to comment.