private void checkKeyBasedEncryption(String type) throws Exception { _currentErr.reset(); KeyBasedFileProcessor.main(new String[] { "-e", "test.txt", "pub." + type }); KeyBasedFileProcessor.main(new String[] { "-d", "test.txt.bpg", "secret." + type, "password" }); assertEquals("no message integrity check", getLine(_currentErr)); KeyBasedFileProcessor.main(new String[] { "-e", "-i", "test.txt", "pub." + type }); KeyBasedFileProcessor.main(new String[] { "-d", "test.txt.bpg", "secret." + type, "password" }); assertEquals("message integrity check passed", getLine(_currentErr)); KeyBasedFileProcessor.main(new String[] { "-e", "-ai", "test.txt", "pub." + type }); KeyBasedFileProcessor.main(new String[] { "-d", "test.txt.asc", "secret." + type, "password" }); assertEquals("message integrity check passed", getLine(_currentErr)); }