My code
String[] command = {
"-list",
"-keystore",
keystoreFile.getAbsolutePath(),
"-storepass",
password
};
try {
sun.security.tools.keytool.Main.main(command);
} catch (Exception e) {
e.printStackTrace();
}
I don't get why the exception is not caught and error message is shown, after that the program is terminated:
keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect
I believe it might be caused by keytool, it doesn't throw anything at all, but just prints the error message and ends the program. If it's so, how I can run keytool and verify that the given configuration is fine and no any errors are here?