public VaultInteractiveSession() {
}
public void start() {
Console console = System.console();
if (console == null) {
System.err.println("No console.");
System.exit(1);
}
while (encDir == null || encDir.length() == 0 || !(encDir.endsWith("/") || encDir.endsWith("\\"))) {
encDir = console
.readLine("Enter directory to store encrypted files (end with either / or \\ based on Unix or Windows:");
}
while (keystoreURL == null || keystoreURL.length() == 0) {
keystoreURL = console.readLine("Enter Keystore URL:");
}
char[] keystorePasswd = getSensitiveValue("Enter Keystore password");
try {
maskedPassword = getMaskedPassword(console, new String(keystorePasswd));
System.out.println(" ");
System.out.println("Please make note of the following:");
System.out.println("********************************************");
System.out.println("Masked Password:" + maskedPassword);
System.out.println("salt:" + salt);
System.out.println("Iteration Count:" + iterationCount);
System.out.println("********************************************");
System.out.println(" ");
} catch (Exception e) {
System.out.println("Exception encountered:" + e.getLocalizedMessage());
}
while (keystoreAlias == null || keystoreAlias.length() == 0) {
keystoreAlias = console.readLine("Enter Keystore Alias:");
}
try {
vault = SecurityVaultFactory.get();
System.out.println("Obtained Vault");