From a988c0af75d96fdf03337b47a68b3a7876abfbac Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Thu, 12 May 2022 13:56:38 +0200 Subject: refact(ernp): change configuration keys for SSL keystore --- .../specific/modules/auth/eidas/v2/Constants.java | 23 ++++++++++++++++++++++ .../auth/eidas/v2/clients/ernp/ErnpRestClient.java | 12 +++++------ .../resources/config/junit_config_1.properties | 10 +++++----- .../config/junit_config_1_springboot.properties | 10 +++++----- 4 files changed, 39 insertions(+), 16 deletions(-) (limited to 'modules') diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java index 0b5d086d..588ea912 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/Constants.java @@ -170,6 +170,29 @@ public class Constants { public static final String CONIG_PROPS_EIDAS_ERNPCLIENT = CONIG_PROPS_EIDAS_PREFIX + ".ernpclient"; public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_ENDPOINT = CONIG_PROPS_EIDAS_ERNPCLIENT + ".endpoint"; + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEYSTORE_PATH = CONIG_PROPS_EIDAS_ERNPCLIENT + + ".ssl.keyStore.path"; + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEYSTORE_PASSWORD = CONIG_PROPS_EIDAS_ERNPCLIENT + + ".ssl.keyStore.password"; + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEYSTORE_TYPE = CONIG_PROPS_EIDAS_ERNPCLIENT + + ".ssl.keyStore.type"; + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEYSTORE_NAME = CONIG_PROPS_EIDAS_ERNPCLIENT + + ".ssl.keyStore.name"; + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEYS_ALIAS = CONIG_PROPS_EIDAS_ERNPCLIENT + + ".ssl.key.alias"; + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEY_PASSWORD = CONIG_PROPS_EIDAS_ERNPCLIENT + + ".ssl.key.password"; + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_TRUSTSTORE_PATH = CONIG_PROPS_EIDAS_ERNPCLIENT + + ".ssl.trustStore.path"; + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_TRUSTSTORE_PASSWORD = CONIG_PROPS_EIDAS_ERNPCLIENT + + ".ssl.trustStore.password"; + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_TRUSTSTORE_TYPE = CONIG_PROPS_EIDAS_ERNPCLIENT + + ".ssl.trustStore.type"; + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_TRUSTSTORE_NAME = CONIG_PROPS_EIDAS_ERNPCLIENT + + ".ssl.trustStore.name"; + + + public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_TIMEOUT_CONNECTION = CONIG_PROPS_EIDAS_ERNPCLIENT + ".timeout.connection"; public static final String CONIG_PROPS_EIDAS_ERNPCLIENT_TIMEOUT_RESPONSE = CONIG_PROPS_EIDAS_ERNPCLIENT diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java index 4c4e3d87..6a732a0d 100644 --- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java +++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/ernp/ErnpRestClient.java @@ -809,16 +809,16 @@ public class ErnpRestClient implements IErnpClient { // Set keystore configuration config.buildKeyStoreConfig( - basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_COMMON_CLIENT_SSL_KEYSTORE_TYPE), - basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_COMMON_CLIENT_SSL_KEYSTORE_PATH), - basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_COMMON_CLIENT_SSL_KEYSTORE_PASSWORD), - basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_COMMON_CLIENT_SSL_KEYSTORE_NAME)); + basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEYSTORE_TYPE), + basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEYSTORE_PATH), + basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEYSTORE_PASSWORD), + basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEYSTORE_NAME)); // Set key information config.setSslKeyAlias( - basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_COMMON_CLIENT_SSL_KEYS_ALIAS)); + basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEYS_ALIAS)); config.setSslKeyPassword( - basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_COMMON_CLIENT_SSL_KEY_PASSWORD)); + basicConfig.getBasicConfiguration(Constants.CONIG_PROPS_EIDAS_ERNPCLIENT_SSL_KEY_PASSWORD)); // Set connection parameters // TODO: update EAAF-components to allow custom HTTP Connection-Timeouts diff --git a/modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_1.properties b/modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_1.properties index d84777f3..6d97513a 100644 --- a/modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_1.properties +++ b/modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_1.properties @@ -104,11 +104,11 @@ eidas.ms.auth.eIDAS.zmrclient.req.update.reason.code=EIDAS-KITT # ERnP communication eidas.ms.auth.eIDAS.ernpclient.endpoint=http://localhost:1718/demoernp eidas.ms.auth.eIDAS.ernpclient.req.organisation.behoerdennr=jUnit123456 -eidas.ms.auth.eIDAS.client.common.ssl.keyStore.type=jks -eidas.ms.auth.eIDAS.client.common.ssl.keyStore.path=../keystore/junit_test.jks -eidas.ms.auth.eIDAS.client.common.ssl.keyStore.password=password -eidas.ms.auth.eIDAS.client.common.ssl.key.alias=meta -eidas.ms.auth.eIDAS.client.common.ssl.key.password=password +eidas.ms.auth.eIDAS.ernpclient.ssl.keyStore.type=jks +eidas.ms.auth.eIDAS.ernpclient.ssl.keyStore.path=../keystore/junit_test.jks +eidas.ms.auth.eIDAS.ernpclient.ssl.keyStore.password=password +eidas.ms.auth.eIDAS.ernpclient.ssl.key.alias=meta +eidas.ms.auth.eIDAS.ernpclient.ssl.key.password=password diff --git a/modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_1_springboot.properties b/modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_1_springboot.properties index 0cc89a4a..22003513 100644 --- a/modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_1_springboot.properties +++ b/modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_1_springboot.properties @@ -60,11 +60,11 @@ eidas.ms.auth.eIDAS.zmrclient.req.update.reason.text=KITT for eIDAS Matching # ERnP communication eidas.ms.auth.eIDAS.ernpclient.endpoint=http://localhost:1718/demoernp eidas.ms.auth.eIDAS.ernpclient.req.organisation.behoerdennr=jUnit123456 -eidas.ms.auth.eIDAS.client.common.ssl.keyStore.type=jks -eidas.ms.auth.eIDAS.client.common.ssl.keyStore.path=../keystore/junit_test.jks -eidas.ms.auth.eIDAS.client.common.ssl.keyStore.password=password -eidas.ms.auth.eIDAS.client.common.ssl.key.alias=meta -eidas.ms.auth.eIDAS.client.common.ssl.key.password=password +eidas.ms.auth.eIDAS.ernpclient.ssl.keyStore.type=jks +eidas.ms.auth.eIDAS.ernpclient.ssl.keyStore.path=../keystore/junit_test.jks +eidas.ms.auth.eIDAS.ernpclient.ssl.keyStore.password=password +eidas.ms.auth.eIDAS.ernpclient.ssl.key.alias=meta +eidas.ms.auth.eIDAS.ernpclient.ssl.key.password=password -- cgit v1.2.3