@Before public void setUpEncryptorAndDecryptor() { // the following keyring contains a primary key with KeyFlag "Certify" and a subkey for signing // and a subkey for encryption encryptor.setKeyFileName(PUB_KEY_RING_SUBKEYS_FILE_NAME); encryptor.setSignatureKeyFileName("org/apache/camel/component/crypto/secringSubKeys.gpg"); encryptor.setSignaturePassword("Abcd1234"); encryptor.setKeyUserid("keyflag"); encryptor.setSignatureKeyUserid("keyflag"); // the following keyring contains a primary key with KeyFlag "Certify" and a subkey for signing // and a subkey for encryption decryptor.setKeyFileName("org/apache/camel/component/crypto/secringSubKeys.gpg"); decryptor.setSignatureKeyFileName(PUB_KEY_RING_SUBKEYS_FILE_NAME); decryptor.setPassword("Abcd1234"); decryptor.setSignatureKeyUserid("keyflag"); }
@Test public void testSignatureVerificationOptionIgnore() throws Exception { // encryptor is sending a PGP message with signature! Decryptor is ignoreing the signature decryptor.setSignatureVerificationOption(PGPDataFormat.SIGNATURE_VERIFICATION_OPTION_IGNORE); decryptor.setSignatureKeyUserids(null); decryptor.setSignatureKeyFileName( null); // no public keyring! --> no signature validation possible String payload = "Test Message"; MockEndpoint mock = getMockEndpoint("mock:unencrypted"); mock.expectedBodiesReceived(payload); template.sendBody("direct:subkey", payload); assertMockEndpointsSatisfied(); }