diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2020-02-17 11:33:09 +0100 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2020-02-17 11:33:09 +0100 |
commit | 3b7eb43b0df868e492ccd7ad2daca5e4c0053bb2 (patch) | |
tree | 93fb63193581f49f2679dc0f2e9263845927afc8 /eaaf_core_utils/src/main | |
parent | dfd7c39666563e7f56fc63c275b58cc37bc2a952 (diff) | |
download | EAAF-Components-3b7eb43b0df868e492ccd7ad2daca5e4c0053bb2.tar.gz EAAF-Components-3b7eb43b0df868e492ccd7ad2daca5e4c0053bb2.tar.bz2 EAAF-Components-3b7eb43b0df868e492ccd7ad2daca5e4c0053bb2.zip |
update jUnit tests to operate on HSM Facade from A-Sit+
Diffstat (limited to 'eaaf_core_utils/src/main')
-rw-r--r-- | eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/credential/KeyStoreConfiguration.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/credential/KeyStoreConfiguration.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/credential/KeyStoreConfiguration.java index 6dbbba3e..970efd22 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/credential/KeyStoreConfiguration.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/credential/KeyStoreConfiguration.java @@ -4,9 +4,10 @@ import java.util.Map; import javax.annotation.Nonnull; +import at.gv.egiz.eaaf.core.exceptions.EaafConfigurationException; + import org.apache.commons.lang3.StringUtils; -import at.gv.egiz.eaaf.core.exceptions.EaafConfigurationException; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -139,7 +140,7 @@ public class KeyStoreConfiguration { /** * Validate the internal state of this configuration object. - * + * * @throws EaafConfigurationException In case of a configuration error */ public void validate() throws EaafConfigurationException { @@ -147,7 +148,7 @@ public class KeyStoreConfiguration { log.trace("Validate HSM-Facade KeyStore ... "); checkConfigurationValue(keyStoreName, EaafKeyStoreFactory.ERRORCODE_07, friendlyName, "Missing 'KeyName' for HSM-Facade"); - + } else if (KeyStoreType.PKCS12.equals(keyStoreType) || KeyStoreType.JKS.equals(keyStoreType)) { log.trace("Validate software KeyStore ... "); @@ -155,13 +156,13 @@ public class KeyStoreConfiguration { friendlyName, "Missing 'KeyPath' for software keystore"); checkConfigurationValue(softKeyStorePassword, EaafKeyStoreFactory.ERRORCODE_07, friendlyName, "Missing 'KeyPassword' for software keystore"); - + } else { log.info("Validation of type: {} not supported yet", keyStoreType); - + } } - + public enum KeyStoreType { PKCS12("pkcs12"), JKS("jks"), HSMFACADE("hsmfacade"), PKCS11("pkcs11"); @@ -209,16 +210,16 @@ public class KeyStoreConfiguration { final String configValue = config.get(configParamKey); checkConfigurationValue(configValue, EaafKeyStoreFactory.ERRORCODE_04, configParamKey); return configValue; - + } - private static void checkConfigurationValue(String configValue, String errorCode, String... params) + private static void checkConfigurationValue(String configValue, String errorCode, String... params) throws EaafConfigurationException { if (StringUtils.isEmpty(configValue)) { - throw new EaafConfigurationException(errorCode, - new Object[] { params}); - + throw new EaafConfigurationException(errorCode, + params); + } - + } } |