summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_auth_sl20/src/test
diff options
context:
space:
mode:
authorThomas <>2021-09-03 10:43:21 +0200
committerThomas <>2021-09-03 10:43:21 +0200
commit0290284cad12912e15dc3b980957695d3e4cc166 (patch)
treeb7ae22aaf6eb8f39d2d5229f5e3a1a20f2e9aeae /eaaf_modules/eaaf_module_auth_sl20/src/test
parent2426de3930f522bd38c5c2fe860ea11005878c8c (diff)
downloadEAAF-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/eaaf_module_auth_sl20/src/test')
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/test/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/AbstractJsonSecurityUtilsTest.java27
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();