}
public TrustManager[] getTrustManager(String algorithm, char[] storePassword) throws KeystoreException {
ensureLoaded(storePassword);
try {
TrustManagerFactory trustFactory = TrustManagerFactory.getInstance(algorithm);
trustFactory.init(keystore);
return trustFactory.getTrustManagers();
} catch (KeyStoreException e) {
throw new KeystoreException("Unable to retrieve trust manager in keystore '" + keystoreName + "'", e);
} catch (NoSuchAlgorithmException e) {
throw new KeystoreException("Unable to retrieve trust manager in keystore '" + keystoreName + "'", e);
}