/**
* Checks if any certificate in the certificate chain is stored in the key store.
* @param chain the certificate chain.
* @return true if any certificate in the certificate chain is stored in the key store.
* @throws IllegalArgumentException if null or zero-length chain is passed in for the chain parameter or if null or zero-length string is passed in for the authType parameter.
* @throws CertificateException if the certificate chain is not trusted by this TrustManager.
*/
private void checkTrusted(X509Certificate[] chain) throws CertificateException {
if (chain == null || chain.length == 0) {
throw new IllegalArgumentException("Null or zero length chain");
}
if (!isChainTrusted(chain)) {
throw new CertificateException("Certificate chain not trusted");
}
}

Example 4

From project JGlobus, under directory /ssl-proxies/src/main/java/org/globus/gsi/bc/.