help(options);
return;
}
try {
PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(cipherName);
if (line.hasOption("decrypt")) {
String pwdArg = (String) line.getArgList().get(0);
char[] encryptdPassword = pwdArg.toCharArray();
System.out.println(cipher.decrypt(encryptdPassword));
} else { // if option neither encrypt/decrypt is specified, we assume
// it is encrypt.
String plainPassword = (String) line.getArgList().get(0);
System.out.println(new String(cipher.encrypt(plainPassword)));
}
} catch (SQLException e) {
System.out.println("Could not load password cipher implementation class. Check your classpath.");