Skip to content

Commit 935f697

Browse files
svenzikmrts
authored andcommitted
Fix deprecated method getSubjectDN() with getSubjectX500Principal()
WE2-960 Signed-off-by: Sven Mitt <[email protected]>
1 parent cdcce7a commit 935f697

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/main/java/eu/webeid/security/exceptions/CertificateNotTrustedException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
public class CertificateNotTrustedException extends AuthTokenException {
3131

3232
public CertificateNotTrustedException(X509Certificate certificate, Throwable e) {
33-
super("Certificate " + certificate.getSubjectDN() + " is not trusted", e);
33+
super("Certificate " + certificate.getSubjectX500Principal() + " is not trusted", e);
3434
}
3535

3636
}

src/main/java/eu/webeid/security/validator/AuthTokenValidatorBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public AuthTokenValidatorBuilder withTrustedCertificateAuthorities(X509Certifica
7777
if (LOG.isDebugEnabled()) {
7878
LOG.debug("Trusted intermediate certificate authorities set to {}",
7979
configuration.getTrustedCACertificates().stream()
80-
.map(X509Certificate::getSubjectDN)
80+
.map(X509Certificate::getSubjectX500Principal)
8181
.collect(Collectors.toList()));
8282
}
8383
return this;

src/main/java/eu/webeid/security/validator/ocsp/OcspResponseValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static void validateHasSigningExtension(X509Certificate certificate) thro
5858
Objects.requireNonNull(certificate, "certificate");
5959
try {
6060
if (certificate.getExtendedKeyUsage() == null || !certificate.getExtendedKeyUsage().contains(OID_OCSP_SIGNING)) {
61-
throw new OCSPCertificateException("Certificate " + certificate.getSubjectDN() +
61+
throw new OCSPCertificateException("Certificate " + certificate.getSubjectX500Principal() +
6262
" does not contain the key usage extension for OCSP response signing");
6363
}
6464
} catch (CertificateParsingException e) {

0 commit comments

Comments
 (0)