public Certificate getCertificate(String alias) { if (!loadKeystoreData()) { return null; } try { return keystore.getCertificate(alias); } catch (KeyStoreException e) { logger.error("Unable to read certificate from keystore", e); } return null; }
public String[] listTrustCertificates() { if (!loadKeystoreData()) { return null; } return (String[]) trustCerts.toArray(new String[trustCerts.size()]); }
public Certificate getCertificate(String alias) { if (!loadKeystoreData()) { return null; } try { return keystore.getCertificate(alias); } catch (KeyStoreException e) { logger.error("Unable to read certificate from keystore", e); } return null; }
public Certificate[] getCertificateChain(String alias) { if (!loadKeystoreData()) { return null; } try { return keystore.getCertificateChain(alias); } catch (KeyStoreException e) { logger.error("Unable to read certificate chain from keystore", e); } return null; }
public Certificate[] getCertificateChain(String alias) { if (!loadKeystoreData()) { return null; } try { return keystore.getCertificateChain(alias); } catch (KeyStoreException e) { logger.error("Unable to read certificate chain from keystore", e); } return null; }
public String[] listTrustCertificates() { if (!loadKeystoreData()) { return null; } return (String[]) trustCerts.toArray(new String[trustCerts.size()]); }
public String getCertificateAlias(Certificate cert) { if (!loadKeystoreData()) { return null; } try { return keystore.getCertificateAlias(cert); } catch (KeyStoreException e) { logger.error("Unable to read retrieve alias for given certificate from keystore", e); } return null; }
public String getCertificateAlias(Certificate cert) { if (!loadKeystoreData()) { return null; } try { return keystore.getCertificateAlias(cert); } catch (KeyStoreException e) { logger.error("Unable to read retrieve alias for given certificate from keystore", e); } return null; }
public KeyManager[] getKeyManager(String algorithm, String keyAlias) throws KeystoreIsLocked, NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException { if (isKeystoreLocked()) { throw new KeystoreIsLocked("Keystore '" + name + "' is locked."); } if (!loadKeystoreData()) { return null; } KeyManagerFactory keyFactory = KeyManagerFactory.getInstance(algorithm); keyFactory.init(keystore, (char[]) keyPasswords.get(keyAlias)); return keyFactory.getKeyManagers(); }
public KeyManager[] getKeyManager(String algorithm, String keyAlias) throws KeystoreIsLocked, NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException { if (isKeystoreLocked()) { throw new KeystoreIsLocked("Keystore '" + name + "' is locked."); } if (!loadKeystoreData()) { return null; } KeyManagerFactory keyFactory = KeyManagerFactory.getInstance(algorithm); keyFactory.init(keystore, (char[]) keyPasswords.get(keyAlias)); return keyFactory.getKeyManagers(); }
public TrustManager[] getTrustManager(String algorithm) throws KeyStoreException, NoSuchAlgorithmException, KeystoreIsLocked { if (isKeystoreLocked()) { throw new KeystoreIsLocked("Keystore '" + name + "' is locked."); } if (!loadKeystoreData()) { return null; } TrustManagerFactory trustFactory = TrustManagerFactory.getInstance(algorithm); trustFactory.init(keystore); return trustFactory.getTrustManagers(); }
public TrustManager[] getTrustManager(String algorithm) throws KeyStoreException, NoSuchAlgorithmException, KeystoreIsLocked { if (isKeystoreLocked()) { throw new KeystoreIsLocked("Keystore '" + name + "' is locked."); } if (!loadKeystoreData()) { return null; } TrustManagerFactory trustFactory = TrustManagerFactory.getInstance(algorithm); trustFactory.init(keystore); return trustFactory.getTrustManagers(); }
public PrivateKey getPrivateKey(String alias) { if (!loadKeystoreData()) { return null; } try { if (isKeyLocked(alias)) { return null; } Key key = keystore.getKey(alias, (char[]) keyPasswords.get(alias)); if (key instanceof PrivateKey) { return (PrivateKey) key; } } catch (KeyStoreException e) { logger.error("Unable to read private key from keystore", e); } catch (NoSuchAlgorithmException e) { logger.error("Unable to read private key from keystore", e); } catch (UnrecoverableKeyException e) { logger.error("Unable to read private key from keystore", e); } return null; }
public PrivateKey getPrivateKey(String alias) { if (!loadKeystoreData()) { return null; } try { if (isKeyLocked(alias)) { return null; } Key key = keystore.getKey(alias, (char[]) keyPasswords.get(alias)); if (key instanceof PrivateKey) { return (PrivateKey) key; } } catch (KeyStoreException e) { logger.error("Unable to read private key from keystore", e); } catch (NoSuchAlgorithmException e) { logger.error("Unable to read private key from keystore", e); } catch (UnrecoverableKeyException e) { logger.error("Unable to read private key from keystore", e); } return null; }