}
}
private void testEncryptAndDecryptWithSignedMessageImpl(String signKeyName, char[] signKeyPassword,
MessageAuthenticationStatus expectedAuthStatus) throws Exception {
StreamBasedKey encryptingKey = null;
StreamBasedKey decryptingKey = null;
StreamBasedKey signatureKey = null;
StreamBasedKey verificationKey = null;
try {
encryptingKey = new StreamBasedKey(RECEIVER_PUBLIC_KEY, RECEIVER_ID);
decryptingKey = new StreamBasedKey(RECEIVER_PRIVATE_KEY);
signatureKey = new StreamBasedKey(signKeyName);
verificationKey = new StreamBasedKey(SENDER_PUBLIC_KEY);
byte[] encrypted = encryptor.signAndEncrypt(CLEAR_TEXT.getBytes("UTF-8"), encryptingKey, false,
signatureKey, signKeyPassword);
decryptor.setVerificationKey(verificationKey);
DecryptionResult result = decryptor.decrypt(encrypted, decryptingKey, RECEIVER_PASSWORD);
assertSame(expectedAuthStatus, result.authenticationStatus());