keyStore = KeyStore.getInstance(type, provider);
}
keyStore.load(input, (keyStorePassword == null || keyStorePassword.length() == 0) ? new char[0] : keyStorePassword.toCharArray());
return keyStore;
} catch (IOException e) {
throw new KeyStoreException(e);
} catch (GeneralSecurityException e) {
throw new KeyStoreException(e);
} catch (Exception e) {
throw new KeyStoreException(e);
} finally {
if (input != null) {
try { input.close(); } catch (Exception ignore) {}
}
}