*/
public boolean validateCertificate(X509Certificate cert, Map context)
throws XWSSecurityException {
if (this.certValidator != null) {
CertificateValidationCallback certValCallback = new CertificateValidationCallback(cert, context);
certValCallback.setValidator(certValidator);
certValCallback.setRevocationEnabled(revocationEnabled);
return certValCallback.getResult();
}
if (this.useXWSSCallbacks) {
CertificateValidationCallback certValCallback = new CertificateValidationCallback(cert, context);
certValCallback.setRevocationEnabled(revocationEnabled);
Callback[] callbacks = new Callback[]{certValCallback};
try {
_handler.handle(callbacks);
} catch (Exception e) {
log.log(Level.SEVERE, LogStringsMessages.WSS_0223_FAILED_CERTIFICATE_VALIDATION());
throw SOAPUtil.newSOAPFaultException(
MessageConstants.WSSE_INVALID_SECURITY_TOKEN,
"Certificate validation failed",
e, true);
}
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Certificate Validation called on certificate " + cert.getSubjectDN());
}
return certValCallback.getResult();
}
/*
use TrustStore and CertStore
*/