@@ -61,7 +61,7 @@ public void shouldFailRSA256VerificationWithInvalidPublicKey() throws Exception
6161 public void shouldFailRSA256VerificationWhenUsingPrivateKey () throws Exception {
6262 exception .expect (SignatureVerificationException .class );
6363 exception .expectMessage ("The Token's Signature resulted invalid when verified using the Algorithm: SHA256withRSA" );
64- exception .expectCause (isA (IllegalArgumentException .class ));
64+ exception .expectCause (isA (IllegalStateException .class ));
6565 exception .expectCause (hasMessage (is ("The given Public Key is null." )));
6666 String jwt = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.dxXF3MdsyW-AuvwJpaQtrZ33fAde9xWxpLIg9cO2tMLH2GSRNuLAe61KsJusZhqZB9Iy7DvflcmRz-9OZndm6cj_ThGeJH2LLc90K83UEvvRPo8l85RrQb8PcanxCgIs2RcZOLygERizB3pr5icGkzR7R2y6zgNCjKJ5_NJ6EiZsGN6_nc2PRK_DbyY-Wn0QDxIxKoA5YgQJ9qafe7IN980pXvQv2Z62c3XR8dYuaXBqhthBj-AbaFHEpZapN-V-TmuLNzR2MCB6Xr7BYMuCaqWf_XU8og4XNe8f_8w9Wv5vvgqMM1KhqVpG5VdMJv4o_L4NoCROHhtUQSLRh2M9cA" ;
6767 Algorithm algorithm = Algorithm .RSA256 ((RSAKey ) readPrivateKeyFromFile (PRIVATE_KEY_FILE , "RSA" ));
@@ -95,7 +95,7 @@ public void shouldFailRSA384VerificationWithInvalidPublicKey() throws Exception
9595 public void shouldFailRSA384VerificationWhenUsingPrivateKey () throws Exception {
9696 exception .expect (SignatureVerificationException .class );
9797 exception .expectMessage ("The Token's Signature resulted invalid when verified using the Algorithm: SHA384withRSA" );
98- exception .expectCause (isA (IllegalArgumentException .class ));
98+ exception .expectCause (isA (IllegalStateException .class ));
9999 exception .expectCause (hasMessage (is ("The given Public Key is null." )));
100100 String jwt = "eyJhbGciOiJSUzM4NCIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.TZlWjXObwGSQOiu2oMq8kiKz0_BR7bbBddNL6G8eZ_GoR82BXOZDqNrQr7lb_M-78XGBguWLWNIdYhzgxOUL9EoCJlrqVm9s9vo6G8T1sj1op-4TbjXZ61TwIvrJee9BvPLdKUJ9_fp1Js5kl6yXkst40Th8Auc5as4n49MLkipjpEhKDKaENKHpSubs1ripSz8SCQZSofeTM_EWVwSw7cpiM8Fy8jOPvWG8Xz4-e3ODFowvHVsDcONX_4FTMNbeRqDuHq2ZhCJnEfzcSJdrve_5VD5fM1LperBVslTrOxIgClOJ3RmM7-WnaizJrWP3D6Z9OLxPxLhM6-jx6tcxEw" ;
101101 Algorithm algorithm = Algorithm .RSA384 ((RSAKey ) readPrivateKeyFromFile (PRIVATE_KEY_FILE , "RSA" ));
@@ -129,7 +129,7 @@ public void shouldFailRSA512VerificationWithInvalidPublicKey() throws Exception
129129 public void shouldFailRSA512VerificationWhenUsingPrivateKey () throws Exception {
130130 exception .expect (SignatureVerificationException .class );
131131 exception .expectMessage ("The Token's Signature resulted invalid when verified using the Algorithm: SHA512withRSA" );
132- exception .expectCause (isA (IllegalArgumentException .class ));
132+ exception .expectCause (isA (IllegalStateException .class ));
133133 exception .expectCause (hasMessage (is ("The given Public Key is null." )));
134134 String jwt = "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.mvL5LoMyIrWYjk5umEXZTmbyIrkbbcVPUkvdGZbu0qFBxGOf0nXP5PZBvPcOu084lvpwVox5n3VaD4iqzW-PsJyvKFgi5TnwmsbKchAp7JexQEsQOnTSGcfRqeUUiBZqRQdYsho71oAB3T4FnalDdFEpM-fztcZY9XqKyayqZLreTeBjqJm4jfOWH7KfGBHgZExQhe96NLq1UA9eUyQwdOA1Z0SgXe4Ja5PxZ6Fm37KnVDtDlNnY4JAAGFo6y74aGNnp_BKgpaVJCGFu1f1S5xCQ1HSvs8ZSdVWs5NgawW3wRd0kRt_GJ_Y3mIwiF4qUyHWGtsSHu_qjVdCTtbFyow" ;
135135 Algorithm algorithm = Algorithm .RSA512 ((RSAKey ) readPrivateKeyFromFile (PRIVATE_KEY_FILE , "RSA" ));
@@ -227,7 +227,7 @@ public void shouldDoRSA256SigningWithBothKeys() throws Exception {
227227 public void shouldFailOnRSA256SigningWhenUsingPublicKey () throws Exception {
228228 exception .expect (SignatureGenerationException .class );
229229 exception .expectMessage ("The Token's Signature couldn't be generated when signing using the Algorithm: SHA256withRSA" );
230- exception .expectCause (isA (IllegalArgumentException .class ));
230+ exception .expectCause (isA (IllegalStateException .class ));
231231 exception .expectCause (hasMessage (is ("The given Private Key is null." )));
232232
233233 Algorithm algorithm = Algorithm .RSA256 ((RSAKey ) readPublicKeyFromFile (PUBLIC_KEY_FILE , "RSA" ));
@@ -267,7 +267,7 @@ public void shouldDoRSA384SigningWithBothKeys() throws Exception {
267267 public void shouldFailOnRSA384SigningWhenUsingPublicKey () throws Exception {
268268 exception .expect (SignatureGenerationException .class );
269269 exception .expectMessage ("The Token's Signature couldn't be generated when signing using the Algorithm: SHA384withRSA" );
270- exception .expectCause (isA (IllegalArgumentException .class ));
270+ exception .expectCause (isA (IllegalStateException .class ));
271271 exception .expectCause (hasMessage (is ("The given Private Key is null." )));
272272
273273 Algorithm algorithm = Algorithm .RSA384 ((RSAKey ) readPublicKeyFromFile (PUBLIC_KEY_FILE , "RSA" ));
@@ -307,7 +307,7 @@ public void shouldDoRSA512SigningWithBothKeys() throws Exception {
307307 public void shouldFailOnRSA512SigningWhenUsingPublicKey () throws Exception {
308308 exception .expect (SignatureGenerationException .class );
309309 exception .expectMessage ("The Token's Signature couldn't be generated when signing using the Algorithm: SHA512withRSA" );
310- exception .expectCause (isA (IllegalArgumentException .class ));
310+ exception .expectCause (isA (IllegalStateException .class ));
311311 exception .expectCause (hasMessage (is ("The given Private Key is null." )));
312312
313313 Algorithm algorithm = Algorithm .RSA512 ((RSAKey ) readPublicKeyFromFile (PUBLIC_KEY_FILE , "RSA" ));
0 commit comments