mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-11-25 08:32:06 +01:00
Add test ckecking that BadData is thrown if KEYS is passed for CERTS
This commit is contained in:
parent
7325cad696
commit
cd208c8942
1 changed files with 11 additions and 0 deletions
|
@ -327,4 +327,15 @@ public class EncryptDecryptTest extends AbstractSOPTest {
|
||||||
.toByteArrayAndResult()
|
.toByteArrayAndResult()
|
||||||
.getBytes());
|
.getBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ParameterizedTest
|
||||||
|
@MethodSource("provideInstances")
|
||||||
|
public void passingSecretKeysForPublicKeysFails(SOP sop) {
|
||||||
|
assertThrows(SOPGPException.BadData.class, () ->
|
||||||
|
sop.encrypt()
|
||||||
|
.withCert(TestData.ALICE_KEY.getBytes(StandardCharsets.UTF_8))
|
||||||
|
.plaintext(TestData.PLAINTEXT.getBytes(StandardCharsets.UTF_8))
|
||||||
|
.toByteArrayAndResult()
|
||||||
|
.getBytes());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue