mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 04:57:56 +01:00
Add test ckecking that BadData is thrown if KEYS is passed for CERTS
This commit is contained in:
parent
a0e7356757
commit
7b04275625
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