CertPathValidator validator = CertPathValidator.getInstance(VALIDATOR_TYPE);
PKIXParameters params = new PKIXParameters(trustRoots);
params.setDate(timeSource.now());
params.setRevocationEnabled(false);
CertificateFactory certFactory = CertificateFactory.getInstance(CERTIFICATE_TYPE);
CertPath certPath = certFactory.generateCertPath(certs);
validator.validate(certPath, params);
} catch (GeneralSecurityException e) {
log.log(Level.WARNING, "Certificate validation failed, certs were: " + certs, e);
throw new CertValidatorException("Certificate validation failure", e);
}