@Override public List<String> getAliases() throws IOException { readLock.lock(); try { ArrayList<String> list = new ArrayList<String>(); String alias = null; try { Enumeration<String> e = keyStore.aliases(); while (e.hasMoreElements()) { alias = e.nextElement(); list.add(alias); } } catch (KeyStoreException e) { throw new IOException("Can't get alias " + alias + " from " + getPathAsString(), e); } return list; } finally { readLock.unlock(); } }
@Override public CredentialEntry getCredentialEntry(String alias) throws IOException { readLock.lock(); try { SecretKeySpec key = null; try { if (!keyStore.containsAlias(alias)) { return null; } key = (SecretKeySpec) keyStore.getKey(alias, password); } catch (KeyStoreException e) { throw new IOException("Can't get credential " + alias + " from " + getPathAsString(), e); } catch (NoSuchAlgorithmException e) { throw new IOException("Can't get algorithm for credential " + alias + " from " + getPathAsString(), e); } catch (UnrecoverableKeyException e) { throw new IOException("Can't recover credential " + alias + " from " + getPathAsString(), e); } return new CredentialEntry(alias, bytesToChars(key.getEncoded())); } finally { readLock.unlock(); } }
throw new IOException("Can't create keystore", e); } catch (GeneralSecurityException e) { throw new IOException("Can't load keystore " + getPathAsString(), e);
@Override public List<String> getAliases() throws IOException { readLock.lock(); try { ArrayList<String> list = new ArrayList<String>(); String alias = null; try { Enumeration<String> e = keyStore.aliases(); while (e.hasMoreElements()) { alias = e.nextElement(); list.add(alias); } } catch (KeyStoreException e) { throw new IOException("Can't get alias " + alias + " from " + getPathAsString(), e); } return list; } finally { readLock.unlock(); } }
@Override public List<String> getAliases() throws IOException { readLock.lock(); try { ArrayList<String> list = new ArrayList<String>(); String alias = null; try { Enumeration<String> e = keyStore.aliases(); while (e.hasMoreElements()) { alias = e.nextElement(); list.add(alias); } } catch (KeyStoreException e) { throw new IOException("Can't get alias " + alias + " from " + getPathAsString(), e); } return list; } finally { readLock.unlock(); } }
@Override public List<String> getAliases() throws IOException { readLock.lock(); try { ArrayList<String> list = new ArrayList<String>(); String alias = null; try { Enumeration<String> e = keyStore.aliases(); while (e.hasMoreElements()) { alias = e.nextElement(); list.add(alias); } } catch (KeyStoreException e) { throw new IOException("Can't get alias " + alias + " from " + getPathAsString(), e); } return list; } finally { readLock.unlock(); } }
@Override public List<String> getAliases() throws IOException { readLock.lock(); try { ArrayList<String> list = new ArrayList<String>(); String alias = null; try { Enumeration<String> e = keyStore.aliases(); while (e.hasMoreElements()) { alias = e.nextElement(); list.add(alias); } } catch (KeyStoreException e) { throw new IOException("Can't get alias " + alias + " from " + getPathAsString(), e); } return list; } finally { readLock.unlock(); } }
@Override public CredentialEntry getCredentialEntry(String alias) throws IOException { readLock.lock(); try { SecretKeySpec key = null; try { if (cache.containsKey(alias)) { return cache.get(alias); } if (!keyStore.containsAlias(alias)) { return null; } key = (SecretKeySpec) keyStore.getKey(alias, password); } catch (KeyStoreException e) { throw new IOException("Can't get credential " + alias + " from " + getPathAsString(), e); } catch (NoSuchAlgorithmException e) { throw new IOException("Can't get algorithm for credential " + alias + " from " + getPathAsString(), e); } catch (UnrecoverableKeyException e) { throw new IOException("Can't recover credential " + alias + " from " + getPathAsString(), e); } return new CredentialEntry(alias, bytesToChars(key.getEncoded())); } finally { readLock.unlock(); } }
@Override public CredentialEntry getCredentialEntry(String alias) throws IOException { readLock.lock(); try { SecretKeySpec key = null; try { if (cache.containsKey(alias)) { return cache.get(alias); } if (!keyStore.containsAlias(alias)) { return null; } key = (SecretKeySpec) keyStore.getKey(alias, password); } catch (KeyStoreException e) { throw new IOException("Can't get credential " + alias + " from " + getPathAsString(), e); } catch (NoSuchAlgorithmException e) { throw new IOException("Can't get algorithm for credential " + alias + " from " + getPathAsString(), e); } catch (UnrecoverableKeyException e) { throw new IOException("Can't recover credential " + alias + " from " + getPathAsString(), e); } return new CredentialEntry(alias, bytesToChars(key.getEncoded())); } finally { readLock.unlock(); } }
@Override public CredentialEntry getCredentialEntry(String alias) throws IOException { readLock.lock(); try { SecretKeySpec key = null; try { if (!keyStore.containsAlias(alias)) { return null; } key = (SecretKeySpec) keyStore.getKey(alias, password); } catch (KeyStoreException e) { throw new IOException("Can't get credential " + alias + " from " + getPathAsString(), e); } catch (NoSuchAlgorithmException e) { throw new IOException("Can't get algorithm for credential " + alias + " from " + getPathAsString(), e); } catch (UnrecoverableKeyException e) { throw new IOException("Can't recover credential " + alias + " from " + getPathAsString(), e); } return new CredentialEntry(alias, bytesToChars(key.getEncoded())); } finally { readLock.unlock(); } }
@Override public CredentialEntry getCredentialEntry(String alias) throws IOException { readLock.lock(); try { SecretKeySpec key = null; try { if (cache.containsKey(alias)) { return cache.get(alias); } if (!keyStore.containsAlias(alias)) { return null; } key = (SecretKeySpec) keyStore.getKey(alias, password); } catch (KeyStoreException e) { throw new IOException("Can't get credential " + alias + " from " + getPathAsString(), e); } catch (NoSuchAlgorithmException e) { throw new IOException("Can't get algorithm for credential " + alias + " from " + getPathAsString(), e); } catch (UnrecoverableKeyException e) { throw new IOException("Can't recover credential " + alias + " from " + getPathAsString(), e); } return new CredentialEntry(alias, bytesToChars(key.getEncoded())); } finally { readLock.unlock(); } }
throw new IOException("Can't create keystore", e); } catch (NoSuchAlgorithmException e) { throw new IOException("Can't load keystore " + getPathAsString(), e); } catch (CertificateException e) { throw new IOException("Can't load keystore " + getPathAsString(), e);
throw new IOException("Can't create keystore", e); } catch (NoSuchAlgorithmException e) { throw new IOException("Can't load keystore " + getPathAsString(), e); } catch (CertificateException e) { throw new IOException("Can't load keystore " + getPathAsString(), e);
throw new IOException("Can't create keystore", e); } catch (NoSuchAlgorithmException e) { throw new IOException("Can't load keystore " + getPathAsString(), e); } catch (CertificateException e) { throw new IOException("Can't load keystore " + getPathAsString(), e);
throw new IOException("Can't create keystore", e); } catch (GeneralSecurityException e) { throw new IOException("Can't load keystore " + getPathAsString(), e);