diff options
author | Thomas <> | 2021-09-03 10:43:21 +0200 |
---|---|---|
committer | Thomas <> | 2021-09-03 10:43:21 +0200 |
commit | 0290284cad12912e15dc3b980957695d3e4cc166 (patch) | |
tree | b7ae22aaf6eb8f39d2d5229f5e3a1a20f2e9aeae /eaaf_modules | |
parent | 2426de3930f522bd38c5c2fe860ea11005878c8c (diff) | |
download | EAAF-Components-0290284cad12912e15dc3b980957695d3e4cc166.tar.gz EAAF-Components-0290284cad12912e15dc3b980957695d3e4cc166.tar.bz2 EAAF-Components-0290284cad12912e15dc3b980957695d3e4cc166.zip |
add jUnit test that uses RSASSA-PSS algorithm
Diffstat (limited to 'eaaf_modules')
-rw-r--r-- | eaaf_modules/eaaf_module_auth_sl20/src/test/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/AbstractJsonSecurityUtilsTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/AbstractJsonSecurityUtilsTest.java b/eaaf_modules/eaaf_module_auth_sl20/src/test/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/AbstractJsonSecurityUtilsTest.java index cfa8868e..89e4b326 100644 --- a/eaaf_modules/eaaf_module_auth_sl20/src/test/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/AbstractJsonSecurityUtilsTest.java +++ b/eaaf_modules/eaaf_module_auth_sl20/src/test/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/AbstractJsonSecurityUtilsTest.java @@ -316,6 +316,33 @@ public abstract class AbstractJsonSecurityUtilsTest { } @Test + public void validSigningRsaPss() throws CertificateEncodingException, KeyStoreException, + JoseException, IOException, EaafException { + + // + config.putConfigValue("modules.sl20.security.sigalg.rsa", "PS256"); + + setRsaSigningKey(); + setRsaEncryptionKey(); + + final String payLoad = "{\"aac\":\"" + RandomStringUtils.randomAlphanumeric(100) + "\"}"; + + final String jws = joseTools.createSignature(payLoad); + Assert.assertNotNull("Signed msg", jws); + + final VerificationResult verify = joseTools.validateSignature( + jws, + keyStoreFactory.buildNewKeyStore(getSigTrustStoreConfigValid()).getFirst(), + getDefaultAlgorithmConstrains()); + Assert.assertTrue("wrong verify state", verify.isValidSigned()); + Assert.assertNotNull("JWS Header", verify.getJoseHeader()); + Assert.assertNotNull("JWS Payload", verify.getPayload()); + Assert.assertNotNull("CertChain", verify.getCertChain()); + + + } + + @Test public void validSigningEc() throws CertificateEncodingException, KeyStoreException, JoseException, IOException, EaafException { setEcSigningKey(); |