From f80e4676a9c35c9d3cee763958483d1266b9108c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Thu, 25 Jan 2024 17:25:10 +0800 Subject: [PATCH] test: add key with invalid length --- src/test/java/com/fingerprint/SealedTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/java/com/fingerprint/SealedTest.java b/src/test/java/com/fingerprint/SealedTest.java index b4182de..e836d24 100644 --- a/src/test/java/com/fingerprint/SealedTest.java +++ b/src/test/java/com/fingerprint/SealedTest.java @@ -49,6 +49,11 @@ public void unsealEventResponseWithInvalidHeaderTest() throws Exception { Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), Sealed.DecryptionAlgorithm.AES_256_GCM ), + new Sealed.DecryptionKey( + //Invalid key + Base64.getDecoder().decode("aW52YWxpZA=="), + Sealed.DecryptionAlgorithm.AES_256_GCM + ), new Sealed.DecryptionKey( key, Sealed.DecryptionAlgorithm.AES_256_GCM @@ -74,6 +79,10 @@ public void unsealEventResponseWithInvalidKeysTest() throws Exception { new Sealed.DecryptionKey( Base64.getDecoder().decode("p2PA7MGy5tx56cnyJacZMr96BCFwZeHjZV2EqMvTq54="), Sealed.DecryptionAlgorithm.AES_256_GCM + ), + new Sealed.DecryptionKey( + Base64.getDecoder().decode("aW52YWxpZA=="), + Sealed.DecryptionAlgorithm.AES_256_GCM ) } ));