summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_auth_sl20/src/test
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-06-22 09:01:10 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-06-22 09:01:10 +0200
commit04cd51a31e54cea00d53417ceb4d82fc068c4d75 (patch)
tree77ae5078e1d7de7884cda6a8266e4793f112046e /eaaf_modules/eaaf_module_auth_sl20/src/test
parent2b4d9dc8fcde4cdd5a13d9524b3a80a59376b4b8 (diff)
downloadEAAF-Components-04cd51a31e54cea00d53417ceb4d82fc068c4d75.tar.gz
EAAF-Components-04cd51a31e54cea00d53417ceb4d82fc068c4d75.tar.bz2
EAAF-Components-04cd51a31e54cea00d53417ceb4d82fc068c4d75.zip
rename test
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/JsonSecurityUtilsHsmKeyTest.java75
1 files changed, 75 insertions, 0 deletions
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/test/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/JsonSecurityUtilsHsmKeyTest.java b/eaaf_modules/eaaf_module_auth_sl20/src/test/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/JsonSecurityUtilsHsmKeyTest.java
new file mode 100644
index 00000000..d9406b2d
--- /dev/null
+++ b/eaaf_modules/eaaf_module_auth_sl20/src/test/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/JsonSecurityUtilsHsmKeyTest.java
@@ -0,0 +1,75 @@
+package at.gv.egiz.eaaf.modules.auth.sl20.utils;
+
+import java.security.KeyStore;
+import java.security.Provider;
+
+import org.apache.commons.lang3.StringUtils;
+import org.junit.runner.RunWith;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import at.gv.egiz.eaaf.core.exceptions.EaafException;
+import at.gv.egiz.eaaf.core.impl.credential.KeyStoreConfiguration;
+import at.gv.egiz.eaaf.core.impl.credential.KeyStoreConfiguration.KeyStoreType;
+import at.gv.egiz.eaaf.core.impl.data.Pair;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration("/spring/test_eaaf_sl20_hsm.beans.xml")
+public class JsonSecurityUtilsHsmKeyTest extends AbstractJsonSecurityUtilsTest {
+
+ @Override
+ protected void setRsaSigningKey() {
+ config.putConfigValue("modules.sl20.security.sign.alias", "rsa-key-1");
+
+ }
+
+ @Override
+ protected void setEcSigningKey() {
+ config.putConfigValue("modules.sl20.security.sign.alias", "ec-key-1");
+
+ }
+
+ @Override
+ protected void setRsaEncryptionKey() {
+ config.putConfigValue("modules.sl20.security.encryption.alias", "rsa-key-1");
+
+ }
+
+ @Override
+ protected void setEcEncryptionKey() {
+ config.putConfigValue("modules.sl20.security.encryption.alias", "ec-key-1");
+
+ }
+
+ @Override
+ protected Pair<KeyStore, Provider> getEncryptionKeyStore() throws EaafException {
+ KeyStoreConfiguration keyConfig = new KeyStoreConfiguration();
+ keyConfig.setFriendlyName("Junit Enc Key Rsa");
+ keyConfig.setKeyStoreType(KeyStoreType.HSMFACADE);
+ keyConfig.setKeyStoreName("eid-junit");
+
+ return keyStoreFactory.buildNewKeyStore(keyConfig);
+ }
+
+ @Override
+ protected String getRsaKeyAlias() {
+ return "rsa-key-1";
+ }
+
+ @Override
+ protected String getRsaKeyPassword() {
+ return StringUtils.EMPTY;
+ }
+
+ @Override
+ protected String getEcKeyAlias() {
+ return "ec-key-1";
+ }
+
+ @Override
+ protected String getEcKeyPassword() {
+ return StringUtils.EMPTY;
+ }
+
+
+}