input.append(keypass).append('\n');
}
result.setInputString(input.toString());
result.setLogInputString(false);
// Try to avoid showing password prompts on log output, as they would be confusing.
LineContainsRegExp filter = new LineContainsRegExp();
RegularExpression rx = new RegularExpression();
// TODO only handles English locale, not ja or zh_CN
rx.setPattern("^(Enter Passphrase for keystore: |Enter key password for .+: )$");
filter.addConfiguredRegexp(rx);
filter.setNegate(true);
result.createErrorFilterChain().addLineContainsRegExp(filter);
}
return result;
}