/** * Get subject name from a certificate, using the currently configured X500DNHandler * and subject DN output format. * * @param cert the certificate being processed * @return the subject name */ protected String getSubjectName(java.security.cert.X509Certificate cert) { if (cert == null) { return null; } if (! DatatypeHelper.isEmpty(options.x500SubjectDNFormat)) { return options.x500DNHandler.getName(cert.getSubjectX500Principal(), options.x500SubjectDNFormat); } else { return options.x500DNHandler.getName(cert.getSubjectX500Principal()); } }
/** * Get issuer name from a certificate, using the currently configured X500DNHandler * and issuer DN output format. * * @param cert the certificate being processed * @return the issuer name */ protected String getIssuerName(java.security.cert.X509Certificate cert) { if (cert == null) { return null; } if (! DatatypeHelper.isEmpty(options.x500IssuerDNFormat)) { return options.x500DNHandler.getName(cert.getIssuerX500Principal(), options.x500IssuerDNFormat); } else { return options.x500DNHandler.getName(cert.getIssuerX500Principal()); } }
/** * Get subject name from a certificate, using the currently configured X500DNHandler * and subject DN output format. * * @param cert the certificate being processed * @return the subject name */ protected String getSubjectName(java.security.cert.X509Certificate cert) { if (cert == null) { return null; } if (! DatatypeHelper.isEmpty(options.x500SubjectDNFormat)) { return options.x500DNHandler.getName(cert.getSubjectX500Principal(), options.x500SubjectDNFormat); } else { return options.x500DNHandler.getName(cert.getSubjectX500Principal()); } }
/** * Get issuer name from a certificate, using the currently configured X500DNHandler * and issuer DN output format. * * @param cert the certificate being processed * @return the issuer name */ protected String getIssuerName(java.security.cert.X509Certificate cert) { if (cert == null) { return null; } if (! DatatypeHelper.isEmpty(options.x500IssuerDNFormat)) { return options.x500DNHandler.getName(cert.getIssuerX500Principal(), options.x500IssuerDNFormat); } else { return options.x500DNHandler.getName(cert.getIssuerX500Principal()); } }
/** * Log information from the constructed cert path at level debug. * * @param buildResult the PKIX cert path builder result containing the cert path and trust anchor * @param targetCert the cert untrusted certificate that was being evaluated */ private void logCertPathDebug(PKIXCertPathBuilderResult buildResult, X509Certificate targetCert) { log.debug("Built valid PKIX cert path"); log.debug("Target certificate: {}", x500DNHandler.getName(targetCert.getSubjectX500Principal())); for (Certificate cert : buildResult.getCertPath().getCertificates()) { log.debug("CertPath certificate: {}", x500DNHandler.getName(((X509Certificate) cert) .getSubjectX500Principal())); } TrustAnchor ta = buildResult.getTrustAnchor(); if (ta.getTrustedCert() != null) { log.debug("TrustAnchor: {}", x500DNHandler.getName(ta.getTrustedCert().getSubjectX500Principal())); } else if (ta.getCA() != null) { log.debug("TrustAnchor: {}", x500DNHandler.getName(ta.getCA())); } else { log.debug("TrustAnchor: {}", ta.getCAName()); } }
/** * Log information from the constructed cert path at level debug. * * @param buildResult the PKIX cert path builder result containing the cert path and trust anchor * @param targetCert the cert untrusted certificate that was being evaluated */ private void logCertPathDebug(PKIXCertPathBuilderResult buildResult, X509Certificate targetCert) { log.debug("Built valid PKIX cert path"); log.debug("Target certificate: {}", x500DNHandler.getName(targetCert.getSubjectX500Principal())); for (Certificate cert : buildResult.getCertPath().getCertificates()) { log.debug("CertPath certificate: {}", x500DNHandler.getName(((X509Certificate) cert) .getSubjectX500Principal())); } TrustAnchor ta = buildResult.getTrustAnchor(); if (ta.getTrustedCert() != null) { log.debug("TrustAnchor: {}", x500DNHandler.getName(ta.getTrustedCert().getSubjectX500Principal())); } else if (ta.getCA() != null) { log.debug("TrustAnchor: {}", x500DNHandler.getName(ta.getCA())); } else { log.debug("TrustAnchor: {}", ta.getCAName()); } }
/** * Get subject name from a certificate, using the currently configured X500DNHandler and subject DN output format. * * @param cert the certificate being processed * @return the subject name */ protected String getSubjectName(X509Certificate cert) { if (cert == null) { return null; } String name = null; if (!DatatypeHelper.isEmpty(certNameOptions.getX500SubjectDNFormat())) { name = certNameOptions.getX500DNHandler().getName(cert.getSubjectX500Principal(), certNameOptions.getX500SubjectDNFormat()); } else { name = certNameOptions.getX500DNHandler().getName(cert.getSubjectX500Principal()); } log.debug("Extracted subject name from certificate: {}", name); return name; }
/** * Log information from the constructed cert path at level debug. * * @param buildResult the PKIX cert path builder result containing the cert path and trust anchor * @param targetCert the cert untrusted certificate that was being evaluated */ private void logCertPathDebug(PKIXCertPathBuilderResult buildResult, X509Certificate targetCert) { log.debug("Built valid PKIX cert path"); log.debug("Target certificate: {}", getX500DNHandler().getName(targetCert.getSubjectX500Principal())); for (Certificate cert : buildResult.getCertPath().getCertificates()) { log.debug("CertPath certificate: {}", getX500DNHandler().getName(((X509Certificate) cert) .getSubjectX500Principal())); } TrustAnchor ta = buildResult.getTrustAnchor(); if (ta.getTrustedCert() != null) { log.debug("TrustAnchor: {}", getX500DNHandler().getName(ta.getTrustedCert().getSubjectX500Principal())); } else if (ta.getCA() != null) { log.debug("TrustAnchor: {}", getX500DNHandler().getName(ta.getCA())); } else { log.debug("TrustAnchor: {}", ta.getCAName()); } }
StringBuilder builder = new StringBuilder(); builder.append('['); builder.append(String.format("subjectName='%s'", x500DNHandler.getName(x500Principal))); if (!DatatypeHelper.isEmpty(credential.getEntityId())) { builder.append(String.format(" |credential entityID='%s'", DatatypeHelper.safeTrimOrNullString(credential
StringBuilder builder = new StringBuilder(); builder.append('['); builder.append(String.format("subjectName='%s'", x500DNHandler.getName(x500Principal))); if (!DatatypeHelper.isEmpty(credential.getEntityId())) { builder.append(String.format(" |credential entityID='%s'", DatatypeHelper.safeTrimOrNullString(credential
if (log.isTraceEnabled()) { log.trace("Added X509CRL to cert store from issuer {} dated {}", x500DNHandler.getName(crl.getIssuerX500Principal()), crl.getThisUpdate()); if (isEmpty) { log.trace("X509CRL added to cert store from issuer {} dated {} was empty", x500DNHandler.getName(crl.getIssuerX500Principal()), crl.getThisUpdate()); x500DNHandler.getName(crl.getIssuerX500Principal()), crl.getNextUpdate()); x500DNHandler.getName(crl.getIssuerX500Principal()), crl.getNextUpdate()); if (log.isTraceEnabled()) { log.trace("Empty X509CRL not added to cert store, from issuer {} dated {}", x500DNHandler.getName(crl.getIssuerX500Principal()), crl.getThisUpdate());
if (log.isTraceEnabled()) { log.trace("Added X509CRL to cert store from issuer {} dated {}", x500DNHandler.getName(crl.getIssuerX500Principal()), crl.getThisUpdate()); if (isEmpty) { log.trace("X509CRL added to cert store from issuer {} dated {} was empty", x500DNHandler.getName(crl.getIssuerX500Principal()), crl.getThisUpdate()); x500DNHandler.getName(crl.getIssuerX500Principal()), crl.getNextUpdate()); x500DNHandler.getName(crl.getIssuerX500Principal()), crl.getNextUpdate()); if (log.isTraceEnabled()) { log.trace("Empty X509CRL not added to cert store, from issuer {} dated {}", x500DNHandler.getName(crl.getIssuerX500Principal()), crl.getThisUpdate());