if (keyStoreName == null || keyStoreName.equalsIgnoreCase("NONE")
|| keyStoreName.length() == 0) {
try {
keyStore.load(null, null);
} catch (IOException e) {
throw new KeyStoreException(e);
} catch (CertificateException e) {
throw new KeyStoreException(e);
} catch (NoSuchAlgorithmException e) {
throw new KeyStoreException(e);
}
} else {
keyStorePwd = (String) AccessController
.doPrivileged(new java.security.PrivilegedAction() {
public Object run() {
return System
.getProperty("javax.net.ssl.trustStorePassword");
}
});
char[] pwd;
if (keyStorePwd == null) {
pwd = new char[0];
} else {
pwd = keyStorePwd.toCharArray();
}
try {
keyStore.load(new FileInputStream(new File(keyStoreName)), pwd);
} catch (FileNotFoundException e) {
throw new KeyStoreException(e);
} catch (IOException e) {
throw new KeyStoreException(e);
} catch (CertificateException e) {
throw new KeyStoreException(e);
} catch (NoSuchAlgorithmException e) {
throw new KeyStoreException(e);
}
}
}
}