public ValidationResult validate ( X509Certificate [ ] certChain ) { certChainSanityChecks ( certChain ) ; String certFingerprint = null ; try { certFingerprint = FingerprintHelper . getFingerprint ( certChain [ certChain . length - 1 ] ) ; } catch ( Throwable t ) { String errorMsg = String . format ( "Error computing fingerprint for " + "certificate: %s. Cause: %s" , CertificateUtils . format ( certChain [ 0 ] , FormatMode . COMPACT_ONE_LINE ) , t . getMessage ( ) ) ; throw new VOMSError ( errorMsg , t ) ; } ValidationResult res = getCachedResult ( certFingerprint ) ; if ( res == null ) { res = validator . validate ( certChain ) ; validationResultsCache . putIfAbsent ( certFingerprint , new CachedValidationResult ( certFingerprint , res ) ) ; } return res ; }
Validates a certificate chain using the wrapped validator caching the result for future validation calls .