private TrustManagersType getTrustManagers(TrustManagersType tmt, String k, String v) { if (tmt == null) { tmt = new TrustManagersType(); } if ("provider".equals(k)) { tmt.setProvider(v); } else if ("factoryAlgorithm".equals(k)) { tmt.setFactoryAlgorithm(v); } else if (k.startsWith("keyStore.")) { tmt.setKeyStore(getKeyStore(tmt.getKeyStore(), k.substring("keyStore.".length()), v)); } else if (k.startsWith("certStore")) { tmt.setCertStore(getCertStore(tmt.getCertStore(), k.substring("certStore.".length()), v)); } return tmt; }
/** * 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(); } }
public static TrustManager[] getTrustManagers() { TrustManagersType tmt = new TrustManagersType(); KeyStoreType kst = new KeyStoreType(); kst.setResource("keys/Truststore.jks"); kst.setPassword("password"); kst.setType("JKS"); tmt.setKeyStore(kst); try { return TLSParameterJaxBUtils.getTrustManagers(tmt, false); } catch (Exception e) { throw new RuntimeException("failed to retrieve trust managers", e); } } }
/** * Create an instance of {@link TrustManagersType } * */ public TrustManagersType createTrustManagersType() { return new TrustManagersType(); }
/** * 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(); } }
public static TrustManager[] getTrustManagers() { TrustManagersType tmt = new TrustManagersType(); KeyStoreType kst = new KeyStoreType(); kst.setResource("keys/Truststore.jks"); kst.setPassword("password"); kst.setType("JKS"); tmt.setKeyStore(kst); try { return TLSParameterJaxBUtils.getTrustManagers(tmt, false); } catch (Exception e) { throw new RuntimeException("failed to retrieve trust managers", e); } } }
/** * Create an instance of {@link TrustManagersType } * */ public TrustManagersType createTrustManagersType() { return new TrustManagersType(); }
private TrustManagersType getTrustManagers(TrustManagersType tmt, String k, String v) { if (tmt == null) { tmt = new TrustManagersType(); } if ("provider".equals(k)) { tmt.setProvider(v); } else if ("factoryAlgorithm".equals(k)) { tmt.setFactoryAlgorithm(v); } else if (k.startsWith("keyStore.")) { tmt.setKeyStore(getKeyStore(tmt.getKeyStore(), k.substring("keyStore.".length()), v)); } else if (k.startsWith("certStore")) { tmt.setCertStore(getCertStore(tmt.getCertStore(), k.substring("certStore.".length()), v)); } return tmt; }
tmc.isSetKeyStore() ? getKeyStore(tmc.getKeyStore(), true) : (tmc.isSetCertStore() ? getKeyStore(tmc.getCertStore()) : null); String alg = tmc.isSetFactoryAlgorithm() ? tmc.getFactoryAlgorithm() : TrustManagerFactory.getDefaultAlgorithm(); tmc.isSetProvider() ? TrustManagerFactory.getInstance(alg, tmc.getProvider()) : TrustManagerFactory.getInstance(alg);
/** * Create an instance of {@link TrustManagersType } * */ public TrustManagersType createTrustManagersType() { return new TrustManagersType(); }
private TrustManagersType getTrustManagers(TrustManagersType tmt, String k, String v) { if (tmt == null) { tmt = new TrustManagersType(); } if ("provider".equals(k)) { tmt.setProvider(v); } else if ("factoryAlgorithm".equals(k)) { tmt.setFactoryAlgorithm(v); } else if (k.startsWith("keyStore.")) { tmt.setKeyStore(getKeyStore(tmt.getKeyStore(), k.substring("keyStore.".length()), v)); } else if (k.startsWith("certStore")) { tmt.setCertStore(getCertStore(tmt.getCertStore(), k.substring("certStore.".length()), v)); } return tmt; }
tmc.isSetKeyStore() ? getKeyStore(tmc.getKeyStore(), true) : (tmc.isSetCertStore() ? getKeyStore(tmc.getCertStore()) : null); String alg = tmc.isSetFactoryAlgorithm() ? tmc.getFactoryAlgorithm() : TrustManagerFactory.getDefaultAlgorithm(); tmc.isSetProvider() ? TrustManagerFactory.getInstance(alg, tmc.getProvider()) : TrustManagerFactory.getInstance(alg);
/** * Create an instance of {@link TrustManagersType } * */ public TrustManagersType createTrustManagersType() { return new TrustManagersType(); }
private TrustManagersType getTrustManagers(TrustManagersType tmt, String k, String v) { if (tmt == null) { tmt = new TrustManagersType(); } if ("provider".equals(k)) { tmt.setProvider(v); } else if ("factoryAlgorithm".equals(k)) { tmt.setFactoryAlgorithm(v); } else if (k.startsWith("keyStore.")) { tmt.setKeyStore(getKeyStore(tmt.getKeyStore(), k.substring("keyStore.".length()), v)); } else if (k.startsWith("certStore")) { tmt.setCertStore(getCertStore(tmt.getCertStore(), k.substring("certStore.".length()), v)); } return tmt; }
private TrustManagersType getTrustManagers(TrustManagersType tmt, String k, String v) { if (tmt == null) { tmt = new TrustManagersType(); } if ("provider".equals(k)) { tmt.setProvider(v); } else if ("factoryAlgorithm".equals(k)) { tmt.setFactoryAlgorithm(v); } else if (k.startsWith("keyStore.")) { tmt.setKeyStore(getKeyStore(tmt.getKeyStore(), k.substring("keyStore.".length()), v)); } else if (k.startsWith("certStore")) { tmt.setCertStore(getCertStore(tmt.getCertStore(), k.substring("certStore.".length()), v)); } return tmt; }
private TrustManagersType getTrustManagers(TrustManagersType tmt, String k, String v) { if (tmt == null) { tmt = new TrustManagersType(); } if ("provider".equals(k)) { tmt.setProvider(v); } else if ("factoryAlgorithm".equals(k)) { tmt.setFactoryAlgorithm(v); } else if (k.startsWith("keyStore.")) { tmt.setKeyStore(getKeyStore(tmt.getKeyStore(), k.substring("keyStore.".length()), v)); } else if (k.startsWith("certStore")) { tmt.setCertStore(getCertStore(tmt.getCertStore(), k.substring("certStore.".length()), v)); } return tmt; }
private TrustManagersType getTrustManagers(TrustManagersType tmt, String k, String v) { if (tmt == null) { tmt = new TrustManagersType(); } if ("provider".equals(k)) { tmt.setProvider(v); } else if ("factoryAlgorithm".equals(k)) { tmt.setFactoryAlgorithm(v); } else if (k.startsWith("keyStore.")) { tmt.setKeyStore(getKeyStore(tmt.getKeyStore(), k.substring("keyStore.".length()), v)); } else if (k.startsWith("certStore")) { tmt.setCertStore(getCertStore(tmt.getCertStore(), k.substring("certStore.".length()), v)); } return tmt; }
private TrustManagersType getTrustManagers(TrustManagersType tmt, String k, String v) { if (tmt == null) { tmt = new TrustManagersType(); } if ("provider".equals(k)) { tmt.setProvider(v); } else if ("factoryAlgorithm".equals(k)) { tmt.setFactoryAlgorithm(v); } else if (k.startsWith("keyStore.")) { tmt.setKeyStore(getKeyStore(tmt.getKeyStore(), k.substring("keyStore.".length()), v)); } else if (k.startsWith("certStore")) { tmt.setCertStore(getCertStore(tmt.getCertStore(), k.substring("certStore.".length()), v)); } return tmt; }