/** * This method converts the JAXB KeyManagersType into a list of * JSSE TrustManagers. */ public static TrustManager[] getTrustManagers(TrustManagersType tmc) throws GeneralSecurityException, IOException { final KeyStore keyStore = tmc.isSetKeyStore() ? getKeyStore(tmc.getKeyStore()) : (tmc.isSetCertStore() ? getKeyStore(tmc.getCertStore()) : (KeyStore) null); String alg = tmc.isSetFactoryAlgorithm() ? tmc.getFactoryAlgorithm() : TrustManagerFactory.getDefaultAlgorithm(); TrustManagerFactory fac = tmc.isSetProvider() ? TrustManagerFactory.getInstance(alg, tmc.getProvider()) : TrustManagerFactory.getInstance(alg); fac.init(keyStore); return fac.getTrustManagers(); } }
/** * This method converts the JAXB KeyManagersType into a list of * JSSE TrustManagers. */ public static TrustManager[] getTrustManagers(TrustManagersType tmc) throws GeneralSecurityException, IOException { final KeyStore keyStore = tmc.isSetKeyStore() ? getKeyStore(tmc.getKeyStore()) : (tmc.isSetCertStore() ? getKeyStore(tmc.getCertStore()) : (KeyStore) null); String alg = tmc.isSetFactoryAlgorithm() ? tmc.getFactoryAlgorithm() : TrustManagerFactory.getDefaultAlgorithm(); TrustManagerFactory fac = tmc.isSetProvider() ? TrustManagerFactory.getInstance(alg, tmc.getProvider()) : TrustManagerFactory.getInstance(alg); fac.init(keyStore); return fac.getTrustManagers(); } }
tmc.isSetKeyStore() ? getKeyStore(tmc.getKeyStore(), true) : (tmc.isSetCertStore()
tmc.isSetKeyStore() ? getKeyStore(tmc.getKeyStore(), true) : (tmc.isSetCertStore()