X500Principal trustedNamePrincipal = null; try { trustedNamePrincipal = x500DNHandler.parse(trustedName); log.debug("Evaluating principal successfully parsed from trusted name: {}", trustedName); if (subjectPrincipal.equals(trustedNamePrincipal)) {
X500Principal trustedNamePrincipal = null; try { trustedNamePrincipal = x500DNHandler.parse(trustedName); log.debug("Evaluating principal successfully parsed from trusted name: {}", trustedName); if (subjectPrincipal.equals(trustedNamePrincipal)) {
/** * Find the certificate from the chain that contains one of the specified subject names. * * @param certs list of certificates to evaluate * @param names X509 subject names to use as search criteria * @return the matching certificate, or null */ protected X509Certificate findCertFromSubjectNames(List<X509Certificate> certs, List<X509SubjectName> names) { for (X509SubjectName subjectName : names) { if (! DatatypeHelper.isEmpty(subjectName.getValue())) { X500Principal subjectX500Principal = null; try { subjectX500Principal = x500DNHandler.parse(subjectName.getValue()); } catch (IllegalArgumentException e) { log.warn("X500 subject name '{}' could not be parsed by configured X500DNHandler '{}'", subjectName.getValue(), x500DNHandler.getClass().getName()); return null; } for (X509Certificate cert : certs) { if (cert.getSubjectX500Principal().equals(subjectX500Principal)) { return cert; } } } } return null; }
/** * Find the certificate from the chain that contains one of the specified subject names. * * @param certs list of certificates to evaluate * @param names X509 subject names to use as search criteria * @return the matching certificate, or null */ protected X509Certificate findCertFromSubjectNames(List<X509Certificate> certs, List<X509SubjectName> names) { for (X509SubjectName subjectName : names) { if (! DatatypeHelper.isEmpty(subjectName.getValue())) { X500Principal subjectX500Principal = null; try { subjectX500Principal = x500DNHandler.parse(subjectName.getValue()); } catch (IllegalArgumentException e) { log.warn("X500 subject name '{}' could not be parsed by configured X500DNHandler '{}'", subjectName.getValue(), x500DNHandler.getClass().getName()); return null; } for (X509Certificate cert : certs) { if (cert.getSubjectX500Principal().equals(subjectX500Principal)) { return cert; } } } } return null; }
X500Principal issuerX500Principal = null; try { issuerX500Principal = x500DNHandler.parse(issuerNameValue); } catch (IllegalArgumentException e) { log.warn("X500 issuer name '{}' could not be parsed by configured X500DNHandler '{}'",
X500Principal issuerX500Principal = null; try { issuerX500Principal = x500DNHandler.parse(issuerNameValue); } catch (IllegalArgumentException e) { log.warn("X500 issuer name '{}' could not be parsed by configured X500DNHandler '{}'",