protected byte[] loadClientCredential(String fileName) throws IOException { if (fileName == null) { return null; } try(InputStream in = getInputStream(fileName); ByteArrayOutputStream out = new ByteArrayOutputStream()) { byte[] buf = new byte[512]; int i = in.read(buf); while (i > 0) { out.write(buf, 0, i); i = in.read(buf); } return out.toByteArray(); } }
protected TrustManager[] createTrustManager() throws Exception { TrustManager[] trustStoreManagers = null; KeyStore trustedCertStore = KeyStore.getInstance(getTrustStoreType()); if (trustStore != null) { try(InputStream tsStream = getInputStream(trustStore)) { trustedCertStore.load(tsStream, trustStorePassword.toCharArray()); TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init(trustedCertStore); trustStoreManagers = tmf.getTrustManagers(); } } return trustStoreManagers; }
protected byte[] loadClientCredential(String fileName) throws IOException { if (fileName == null) { return null; } try(InputStream in = getInputStream(fileName); ByteArrayOutputStream out = new ByteArrayOutputStream()) { byte[] buf = new byte[512]; int i = in.read(buf); while (i > 0) { out.write(buf, 0, i); i = in.read(buf); } return out.toByteArray(); } }
protected byte[] loadClientCredential(String fileName) throws IOException { if (fileName == null) { return null; } try(InputStream in = getInputStream(fileName); ByteArrayOutputStream out = new ByteArrayOutputStream()) { byte[] buf = new byte[512]; int i = in.read(buf); while (i > 0) { out.write(buf, 0, i); i = in.read(buf); } return out.toByteArray(); } }
protected byte[] loadClientCredential(String fileName) throws IOException { if (fileName == null) { return null; } try(InputStream in = getInputStream(fileName); ByteArrayOutputStream out = new ByteArrayOutputStream()) { byte[] buf = new byte[512]; int i = in.read(buf); while (i > 0) { out.write(buf, 0, i); i = in.read(buf); } return out.toByteArray(); } }
protected TrustManager[] createTrustManager() throws Exception { TrustManager[] trustStoreManagers = null; KeyStore trustedCertStore = KeyStore.getInstance(getTrustStoreType()); if (trustStore != null) { try(InputStream tsStream = getInputStream(trustStore)) { trustedCertStore.load(tsStream, trustStorePassword.toCharArray()); TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init(trustedCertStore); trustStoreManagers = tmf.getTrustManagers(); } } return trustStoreManagers; }
protected TrustManager[] createTrustManager() throws Exception { TrustManager[] trustStoreManagers = null; KeyStore trustedCertStore = KeyStore.getInstance(getTrustStoreType()); if (trustStore != null) { try(InputStream tsStream = getInputStream(trustStore)) { trustedCertStore.load(tsStream, trustStorePassword.toCharArray()); TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init(trustedCertStore); trustStoreManagers = tmf.getTrustManagers(); } } return trustStoreManagers; }
protected TrustManager[] createTrustManager() throws Exception { TrustManager[] trustStoreManagers = null; KeyStore trustedCertStore = KeyStore.getInstance(getTrustStoreType()); if (trustStore != null) { try(InputStream tsStream = getInputStream(trustStore)) { trustedCertStore.load(tsStream, trustStorePassword.toCharArray()); TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init(trustedCertStore); trustStoreManagers = tmf.getTrustManagers(); } } return trustStoreManagers; }