@Test public void test_loadKeyStore() throws KeyStoreException{ KeyStore keyStore; try { keyStore = SSLUtil.loadKeyStore(path, "123456"); } catch (RdapClientException e) { keyStore = null; } assertEquals("test", keyStore.aliases().nextElement()); }
public static KeyStore loadKeyStore(String filePath, String password) throws RdapClientException { KeyStore ks; try { ks = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream in = new FileInputStream(filePath); ks.load(in, password.toCharArray()); } catch (KeyStoreException e) { throw new RdapClientException(e.getMessage()); } catch (CertificateException e) { throw new RdapClientException(e.getMessage()); } catch (NoSuchAlgorithmException e) { throw new RdapClientException(e.getMessage()); } catch (IOException e) { throw new RdapClientException(e.getMessage()); } return ks; }
SSLUtil { public static KeyStore loadKeyStore(String filePath, String password) throws RdapClientException { KeyStore ks; try { ks = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream in = new FileInputStream(filePath); ks.load(in, password.toCharArray()); } catch (KeyStoreException e) { throw new RdapClientException(e.getMessage()); } catch (CertificateException e) { throw new RdapClientException(e.getMessage()); } catch (NoSuchAlgorithmException e) { throw new RdapClientException(e.getMessage()); } catch (IOException e) { throw new RdapClientException(e.getMessage()); } return ks; } }
SSLUtil { public static KeyStore loadKeyStore(String filePath, String password) throws RdapClientException { KeyStore ks; try { ks = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream in = new FileInputStream(filePath); ks.load(in, password.toCharArray()); } catch (KeyStoreException e) { throw new RdapClientException(e.getMessage()); } catch (CertificateException e) { throw new RdapClientException(e.getMessage()); } catch (NoSuchAlgorithmException e) { throw new RdapClientException(e.getMessage()); } catch (IOException e) { throw new RdapClientException(e.getMessage()); } return ks; } private  SSLUtil(); }
SSLUtil { public static KeyStore loadKeyStore(String filePath, String password) throws RdapClientException { KeyStore ks; try { ks = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream in = new FileInputStream(filePath); ks.load(in, password.toCharArray()); } catch (KeyStoreException e) { throw new RdapClientException(e.getMessage()); } catch (CertificateException e) { throw new RdapClientException(e.getMessage()); } catch (NoSuchAlgorithmException e) { throw new RdapClientException(e.getMessage()); } catch (IOException e) { throw new RdapClientException(e.getMessage()); } return ks; } private  SSLUtil(); static KeyStore loadKeyStore(String filePath, String password); static TrustManager[] getTrustManager(KeyStore ks); static SSLSocketFactory getSSLSocketFactory(TrustManager[] managers); }
SSLUtil { public static KeyStore loadKeyStore(String filePath, String password) throws RdapClientException { KeyStore ks; try { ks = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream in = new FileInputStream(filePath); ks.load(in, password.toCharArray()); } catch (KeyStoreException e) { throw new RdapClientException(e.getMessage()); } catch (CertificateException e) { throw new RdapClientException(e.getMessage()); } catch (NoSuchAlgorithmException e) { throw new RdapClientException(e.getMessage()); } catch (IOException e) { throw new RdapClientException(e.getMessage()); } return ks; } private  SSLUtil(); static KeyStore loadKeyStore(String filePath, String password); static TrustManager[] getTrustManager(KeyStore ks); static SSLSocketFactory getSSLSocketFactory(TrustManager[] managers);  }