File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
Mastercard.Developer.ClientEncryption.Tests/NetCore2/Encryption/JWE Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,34 @@ public class GcmJweObjectTest
12
12
#if ! NETCOREAPP3_1 && ! NET5_0_OR_GREATER
13
13
[ ExpectedException ( typeof ( EncryptionException ) , "AES/GCM/NoPadding is unsupported on .NET Standard < 2.1" ) ]
14
14
#endif
15
- public void TestDecrypt_ShouldReturnDecryptedPayload_WhenPayloadIsGcmEncrypted ( )
15
+ public void TestDecrypt_ShouldReturnDecryptedPayload_WhenPayloadIs256GcmEncrypted ( )
16
16
{
17
17
// GIVEN
18
- JweObject jweObject = TestUtils . GetTestGcmJweObject ( ) ;
18
+ JweObject jweObject = TestUtils . GetTest256GcmJweObject ( ) ;
19
+
20
+ // WHEN
21
+ string decryptedPayload = jweObject . Decrypt ( TestUtils . GetTestJweConfigBuilder ( ) . Build ( ) ) ;
22
+
23
+ // THEN
24
+ Assert . AreEqual ( "{\" foo\" :\" bar\" }" , decryptedPayload ) ;
25
+ }
26
+
27
+ public void TestDecrypt_ShouldReturnDecryptedPayload_WhenPayloadIs192GcmEncrypted ( )
28
+ {
29
+ // GIVEN
30
+ JweObject jweObject = TestUtils . GetTest192GcmJweObject ( ) ;
31
+
32
+ // WHEN
33
+ string decryptedPayload = jweObject . Decrypt ( TestUtils . GetTestJweConfigBuilder ( ) . Build ( ) ) ;
34
+
35
+ // THEN
36
+ Assert . AreEqual ( "{\" foo\" :\" bar\" }" , decryptedPayload ) ;
37
+ }
38
+
39
+ public void TestDecrypt_ShouldReturnDecryptedPayload_WhenPayloadIs128GcmEncrypted ( )
40
+ {
41
+ // GIVEN
42
+ JweObject jweObject = TestUtils . GetTest128GcmJweObject ( ) ;
19
43
20
44
// WHEN
21
45
string decryptedPayload = jweObject . Decrypt ( TestUtils . GetTestJweConfigBuilder ( ) . Build ( ) ) ;
You can’t perform that action at this time.
0 commit comments