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());
assertSame(MessageIntegrity.INTEGRITY_VERIFIED, result.messageIntegrity());
assertEquals(CLEAR_TEXT, new String(result.message(), "UTF-8"));
} catch (Exception ex) {
fail();
} finally {
KongaIoUtils.close(encryptingKey);
KongaIoUtils.close(decryptingKey);