/** * Gets the initialized trust managers. */ protected TrustManager[] getTrustManagers(String algorithm) throws Exception { String crlFile = (String) attributes.get("crlFile"); TrustManager[] tms = null; KeyStore trustStore = getTrustStore(); if (trustStore != null) { if (crlFile == null) { TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm); tmf.init(trustStore); tms = tmf.getTrustManagers(); } else { TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm); CertPathParameters params = getParameters(algorithm, crlFile, trustStore); ManagerFactoryParameters mfp = new CertPathTrustManagerParameters(params); tmf.init(mfp); tms = tmf.getTrustManagers(); } } return tms; }
/** * Gets the initialized trust managers. */ protected TrustManager[] getTrustManagers(String algorithm) throws Exception { String crlFile = (String) attributes.get("crlFile"); TrustManager[] tms = null; KeyStore trustStore = getTrustStore(); if (trustStore != null) { if (crlFile == null) { TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm); tmf.init(trustStore); tms = tmf.getTrustManagers(); } else { TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm); CertPathParameters params = getParameters(algorithm, crlFile, trustStore); ManagerFactoryParameters mfp = new CertPathTrustManagerParameters(params); tmf.init(mfp); tms = tmf.getTrustManagers(); } } return tms; }