private CertStoreType getCertStore(CertStoreType cs, String k, String v) { if (cs == null) { cs = new CertStoreType(); } if ("file".equals(k)) { cs.setFile(v); } else if ("url".equals(k)) { cs.setUrl(v); } else if ("resource".equals(k)) { cs.setResource(v); } return cs; }
if (pst.isSetType()) { type = pst.getType(); } else { type = KeyStore.getDefaultType(); if (pst.isSetFile()) { InputStream is = Files.newInputStream(Paths.get(pst.getFile())); return createTrustStore(is, type); if (pst.isSetResource()) { final InputStream is = getResourceAsStream(pst.getResource()); if (is == null) { final String msg = "Could not load truststore resource " + pst.getResource(); LOG.severe(msg); throw new IOException(msg); if (pst.isSetUrl()) { return createTrustStore(new URL(pst.getUrl()).openStream(), type);
/** * This method converts a JAXB generated CertStoreType into a KeyStore. */ public static KeyStore getKeyStore(final CertStoreType pst) throws IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException { if (pst == null) { return null; } if (pst.isSetFile()) { return createTrustStore(new FileInputStream(pst.getFile())); } if (pst.isSetResource()) { final java.io.InputStream is = getResourceAsStream(pst.getResource()); if (is == null) { final String msg = "Could not load truststore resource " + pst.getResource(); LOG.severe(msg); throw new java.io.IOException(msg); } return createTrustStore(is); } if (pst.isSetUrl()) { return createTrustStore(new URL(pst.getUrl()).openStream()); } // TODO error? return null; }
/** * Create an instance of {@link CertStoreType } * */ public CertStoreType createCertStoreType() { return new CertStoreType(); }
if (pst.isSetType()) { type = pst.getType(); } else { type = KeyStore.getDefaultType(); if (pst.isSetFile()) { InputStream is = Files.newInputStream(Paths.get(pst.getFile())); return createTrustStore(is, type); if (pst.isSetResource()) { final InputStream is = getResourceAsStream(pst.getResource()); if (is == null) { final String msg = "Could not load truststore resource " + pst.getResource(); LOG.severe(msg); throw new IOException(msg); if (pst.isSetUrl()) { return createTrustStore(new URL(pst.getUrl()).openStream(), type);
/** * This method converts a JAXB generated CertStoreType into a KeyStore. */ public static KeyStore getKeyStore(final CertStoreType pst) throws IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException { if (pst == null) { return null; } if (pst.isSetFile()) { return createTrustStore(new FileInputStream(pst.getFile())); } if (pst.isSetResource()) { final java.io.InputStream is = getResourceAsStream(pst.getResource()); if (is == null) { final String msg = "Could not load truststore resource " + pst.getResource(); LOG.severe(msg); throw new java.io.IOException(msg); } return createTrustStore(is); } if (pst.isSetUrl()) { return createTrustStore(new URL(pst.getUrl()).openStream()); } // TODO error? return null; }
/** * Create an instance of {@link CertStoreType } * */ public CertStoreType createCertStoreType() { return new CertStoreType(); }
private CertStoreType getCertStore(CertStoreType cs, String k, String v) { if (cs == null) { cs = new CertStoreType(); } if ("file".equals(k)) { cs.setFile(v); } else if ("url".equals(k)) { cs.setUrl(v); } else if ("resource".equals(k)) { cs.setResource(v); } return cs; }
/** * Create an instance of {@link CertStoreType } * */ public CertStoreType createCertStoreType() { return new CertStoreType(); }
private CertStoreType getCertStore(CertStoreType cs, String k, String v) { if (cs == null) { cs = new CertStoreType(); } if ("file".equals(k)) { cs.setFile(v); } else if ("url".equals(k)) { cs.setUrl(v); } else if ("resource".equals(k)) { cs.setResource(v); } return cs; }
/** * Create an instance of {@link CertStoreType } * */ public CertStoreType createCertStoreType() { return new CertStoreType(); }
private CertStoreType getCertStore(CertStoreType cs, String k, String v) { if (cs == null) { cs = new CertStoreType(); } if ("file".equals(k)) { cs.setFile(v); } else if ("url".equals(k)) { cs.setUrl(v); } else if ("resource".equals(k)) { cs.setResource(v); } return cs; }
private CertStoreType getCertStore(CertStoreType cs, String k, String v) { if (cs == null) { cs = new CertStoreType(); } if ("file".equals(k)) { cs.setFile(v); } else if ("url".equals(k)) { cs.setUrl(v); } else if ("resource".equals(k)) { cs.setResource(v); } return cs; }
private CertStoreType getCertStore(CertStoreType cs, String k, String v) { if (cs == null) { cs = new CertStoreType(); } if ("file".equals(k)) { cs.setFile(v); } else if ("url".equals(k)) { cs.setUrl(v); } else if ("resource".equals(k)) { cs.setResource(v); } return cs; }
private CertStoreType getCertStore(CertStoreType cs, String k, String v) { if (cs == null) { cs = new CertStoreType(); } if ("file".equals(k)) { cs.setFile(v); } else if ("url".equals(k)) { cs.setUrl(v); } else if ("resource".equals(k)) { cs.setResource(v); } return cs; }
private CertStoreType getCertStore(CertStoreType cs, String k, String v) { if (cs == null) { cs = new CertStoreType(); } if ("file".equals(k)) { cs.setFile(v); } else if ("url".equals(k)) { cs.setUrl(v); } else if ("resource".equals(k)) { cs.setResource(v); } return cs; }