From 10e70b08ac853ebe2b8a2c2a62c6224c817551ce Mon Sep 17 00:00:00 2001 From: Stilianos Tzouvaras Date: Wed, 20 Nov 2024 19:12:13 +0200 Subject: [PATCH 1/2] RQES Config refactored --- .../businesslogic/config/ConfigLogicImpl.kt | 30 +----------- .../ec/businesslogic/config/RQESConfigImpl.kt | 49 +++++++++++++++++++ .../businesslogic/config/ConfigLogicImpl.kt | 30 +----------- .../ec/businesslogic/config/RQESConfigImpl.kt | 49 +++++++++++++++++++ 4 files changed, 100 insertions(+), 58 deletions(-) create mode 100644 business-logic/src/demo/java/eu/europa/ec/businesslogic/config/RQESConfigImpl.kt create mode 100644 business-logic/src/dev/java/eu/europa/ec/businesslogic/config/RQESConfigImpl.kt diff --git a/business-logic/src/demo/java/eu/europa/ec/businesslogic/config/ConfigLogicImpl.kt b/business-logic/src/demo/java/eu/europa/ec/businesslogic/config/ConfigLogicImpl.kt index ba978601..29b9fd05 100644 --- a/business-logic/src/demo/java/eu/europa/ec/businesslogic/config/ConfigLogicImpl.kt +++ b/business-logic/src/demo/java/eu/europa/ec/businesslogic/config/ConfigLogicImpl.kt @@ -16,14 +16,7 @@ package eu.europa.ec.businesslogic.config -import eu.europa.ec.businesslogic.BuildConfig -import eu.europa.ec.eudi.rqes.HashAlgorithmOID -import eu.europa.ec.eudi.rqes.SigningAlgorithmOID -import eu.europa.ec.eudi.rqesui.domain.extension.toUri import eu.europa.ec.eudi.rqesui.infrastructure.config.EudiRQESUiConfig -import eu.europa.ec.eudi.rqesui.infrastructure.config.RqesServiceConfig -import eu.europa.ec.eudi.rqesui.infrastructure.config.data.QtspData -import java.net.URI class ConfigLogicImpl : ConfigLogic { override val appFlavor: AppFlavor @@ -33,7 +26,7 @@ class ConfigLogicImpl : ConfigLogic { get() = DemoEnvironmentConfig() override val rqesConfig: EudiRQESUiConfig - get() = RqesConfig() + get() = RQESConfigImpl() } private class DemoEnvironmentConfig : EnvironmentConfig() { @@ -41,25 +34,4 @@ private class DemoEnvironmentConfig : EnvironmentConfig() { ServerConfig.Debug -> "" ServerConfig.Release -> "" } -} - -private class RqesConfig : EudiRQESUiConfig { - - override val rqesServiceConfig: RqesServiceConfig - get() = RqesServiceConfig( - clientId = "wallet-client", - clientSecret = "somesecret2", - authFlowRedirectionURI = URI.create(BuildConfig.RQES_DEEPLINK), - signingAlgorithm = SigningAlgorithmOID.RSA, - hashAlgorithm = HashAlgorithmOID.SHA_256, - ) - - override val qtsps: List - get() = listOf( - QtspData( - name = "Wallet-Centric", - endpoint = "https://walletcentric.signer.eudiw.dev/csc/v2".toUri(), - scaUrl = "https://walletcentric.signer.eudiw.dev", - ) - ) } \ No newline at end of file diff --git a/business-logic/src/demo/java/eu/europa/ec/businesslogic/config/RQESConfigImpl.kt b/business-logic/src/demo/java/eu/europa/ec/businesslogic/config/RQESConfigImpl.kt new file mode 100644 index 00000000..0e150bcd --- /dev/null +++ b/business-logic/src/demo/java/eu/europa/ec/businesslogic/config/RQESConfigImpl.kt @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 European Commission + * + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work + * except in compliance with the Licence. + * + * You may obtain a copy of the Licence at: + * https://joinup.ec.europa.eu/software/page/eupl + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF + * ANY KIND, either express or implied. See the Licence for the specific language + * governing permissions and limitations under the Licence. + */ + +package eu.europa.ec.businesslogic.config + +import eu.europa.ec.businesslogic.BuildConfig +import eu.europa.ec.eudi.rqes.HashAlgorithmOID +import eu.europa.ec.eudi.rqes.SigningAlgorithmOID +import eu.europa.ec.eudi.rqesui.domain.extension.toUri +import eu.europa.ec.eudi.rqesui.infrastructure.config.EudiRQESUiConfig +import eu.europa.ec.eudi.rqesui.infrastructure.config.RqesServiceConfig +import eu.europa.ec.eudi.rqesui.infrastructure.config.data.QtspData +import java.net.URI + +class RQESConfigImpl : EudiRQESUiConfig { + + override val rqesServiceConfig: RqesServiceConfig + get() = RqesServiceConfig( + clientId = "wallet-client", + clientSecret = "somesecret2", + authFlowRedirectionURI = URI.create(BuildConfig.RQES_DEEPLINK), + signingAlgorithm = SigningAlgorithmOID.RSA, + hashAlgorithm = HashAlgorithmOID.SHA_256, + ) + + override val qtsps: List + get() = listOf( + QtspData( + name = "Wallet-Centric", + endpoint = "https://walletcentric.signer.eudiw.dev/csc/v2".toUri(), + scaUrl = "https://walletcentric.signer.eudiw.dev", + ) + ) + + override val printLogs: Boolean get() = BuildConfig.DEBUG +} \ No newline at end of file diff --git a/business-logic/src/dev/java/eu/europa/ec/businesslogic/config/ConfigLogicImpl.kt b/business-logic/src/dev/java/eu/europa/ec/businesslogic/config/ConfigLogicImpl.kt index 6dea9144..a080aace 100644 --- a/business-logic/src/dev/java/eu/europa/ec/businesslogic/config/ConfigLogicImpl.kt +++ b/business-logic/src/dev/java/eu/europa/ec/businesslogic/config/ConfigLogicImpl.kt @@ -16,14 +16,7 @@ package eu.europa.ec.businesslogic.config -import eu.europa.ec.businesslogic.BuildConfig -import eu.europa.ec.eudi.rqes.HashAlgorithmOID -import eu.europa.ec.eudi.rqes.SigningAlgorithmOID -import eu.europa.ec.eudi.rqesui.domain.extension.toUri import eu.europa.ec.eudi.rqesui.infrastructure.config.EudiRQESUiConfig -import eu.europa.ec.eudi.rqesui.infrastructure.config.RqesServiceConfig -import eu.europa.ec.eudi.rqesui.infrastructure.config.data.QtspData -import java.net.URI class ConfigLogicImpl : ConfigLogic { override val appFlavor: AppFlavor @@ -33,7 +26,7 @@ class ConfigLogicImpl : ConfigLogic { get() = DevEnvironmentConfig() override val rqesConfig: EudiRQESUiConfig - get() = RqesConfig() + get() = RQESConfigImpl() } private class DevEnvironmentConfig : EnvironmentConfig() { @@ -41,25 +34,4 @@ private class DevEnvironmentConfig : EnvironmentConfig() { ServerConfig.Debug -> "" ServerConfig.Release -> "" } -} - -private class RqesConfig : EudiRQESUiConfig { - - override val rqesServiceConfig: RqesServiceConfig - get() = RqesServiceConfig( - clientId = "wallet-client", - clientSecret = "somesecret2", - authFlowRedirectionURI = URI.create(BuildConfig.RQES_DEEPLINK), - signingAlgorithm = SigningAlgorithmOID.RSA, - hashAlgorithm = HashAlgorithmOID.SHA_256, - ) - - override val qtsps: List - get() = listOf( - QtspData( - name = "Wallet-Centric", - endpoint = "https://walletcentric.signer.eudiw.dev/csc/v2".toUri(), - scaUrl = "https://walletcentric.signer.eudiw.dev", - ) - ) } \ No newline at end of file diff --git a/business-logic/src/dev/java/eu/europa/ec/businesslogic/config/RQESConfigImpl.kt b/business-logic/src/dev/java/eu/europa/ec/businesslogic/config/RQESConfigImpl.kt new file mode 100644 index 00000000..0e150bcd --- /dev/null +++ b/business-logic/src/dev/java/eu/europa/ec/businesslogic/config/RQESConfigImpl.kt @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 European Commission + * + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European + * Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work + * except in compliance with the Licence. + * + * You may obtain a copy of the Licence at: + * https://joinup.ec.europa.eu/software/page/eupl + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF + * ANY KIND, either express or implied. See the Licence for the specific language + * governing permissions and limitations under the Licence. + */ + +package eu.europa.ec.businesslogic.config + +import eu.europa.ec.businesslogic.BuildConfig +import eu.europa.ec.eudi.rqes.HashAlgorithmOID +import eu.europa.ec.eudi.rqes.SigningAlgorithmOID +import eu.europa.ec.eudi.rqesui.domain.extension.toUri +import eu.europa.ec.eudi.rqesui.infrastructure.config.EudiRQESUiConfig +import eu.europa.ec.eudi.rqesui.infrastructure.config.RqesServiceConfig +import eu.europa.ec.eudi.rqesui.infrastructure.config.data.QtspData +import java.net.URI + +class RQESConfigImpl : EudiRQESUiConfig { + + override val rqesServiceConfig: RqesServiceConfig + get() = RqesServiceConfig( + clientId = "wallet-client", + clientSecret = "somesecret2", + authFlowRedirectionURI = URI.create(BuildConfig.RQES_DEEPLINK), + signingAlgorithm = SigningAlgorithmOID.RSA, + hashAlgorithm = HashAlgorithmOID.SHA_256, + ) + + override val qtsps: List + get() = listOf( + QtspData( + name = "Wallet-Centric", + endpoint = "https://walletcentric.signer.eudiw.dev/csc/v2".toUri(), + scaUrl = "https://walletcentric.signer.eudiw.dev", + ) + ) + + override val printLogs: Boolean get() = BuildConfig.DEBUG +} \ No newline at end of file From 60817a87f0241c95deb5b764d293d39e360a7735 Mon Sep 17 00:00:00 2001 From: "Tzouvaras, Stilianos" Date: Wed, 20 Nov 2024 19:26:38 +0200 Subject: [PATCH 2/2] Update configuration.md --- wiki/configuration.md | 80 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 11 deletions(-) diff --git a/wiki/configuration.md b/wiki/configuration.md index 151b64ec..87408f97 100644 --- a/wiki/configuration.md +++ b/wiki/configuration.md @@ -14,8 +14,7 @@ The application allows the configuration of: -1. Verifier API -2. Issuing API +1. Issuing API Via the *WalletCoreConfig* interface inside the business-logic module. @@ -35,6 +34,28 @@ You can configure the *EudiWalletConfig* per flavor. You can find both implement } ``` +2. Trusted certificates + +Via the *WalletCoreConfig* interface. + +``` +interface WalletCoreConfig { + val config: EudiWalletConfig +} +``` + +Same as the Verifier and Issuing APIs you can configure the Trusted certificates for the *EudiWalletConfig* per flavor inside the core-logic module at src/demo/config/WalletCoreConfigImpl and src/dev/config/WalletCoreConfigImpl + +``` +_config = EudiWalletConfig.Builder(context) + .trustedReaderCertificates(R.raw.eudi_pid_issuer_ut) + .build() +``` + +The application's IACA certificates are located [here](https://github.com/eu-digital-identity-wallet/eudi-app-android-wallet-ui/tree/main/resources-logic/src/main/res/raw) + +3. Preregistered Client Scheme + If you plan to use the *ClientIdScheme.Preregistered* for OpenId4VP configuration, please add the following to the configuration files. ``` @@ -59,25 +80,62 @@ const val OPENID4VP_VERIFIER_CLIENT_ID = "your_verifier_client_id" } ``` -3. Trusted certificates +4. RQES -Via the *WalletCoreConfig* interface. +Via the *ConfigLogic* interface inside the business-logic module. ``` -interface WalletCoreConfig { - val config: EudiWalletConfig +interface ConfigLogic { + /** + * RQES Config. + */ + val rqesConfig: EudiRQESUiConfig } ``` -Same as the Verifier and Issuing APIs you can configure the Trusted certificates for the *EudiWalletConfig* per flavor inside the core-logic module at src/demo/config/WalletCoreConfigImpl and src/dev/config/WalletCoreConfigImpl +You can configure the *RQESConfig*, which implements the EudiRQESUiConfig interface from the RQESUi SDK, per flavor. You can find both implementations inside the business-logic module at src/demo/config/RQESConfigImpl and src/dev/config/RQESConfigImpl. ``` -_config = EudiWalletConfig.Builder(context) - .trustedReaderCertificates(R.raw.eudi_pid_issuer_ut) - .build() +class RQESConfigImpl : EudiRQESUiConfig { + + override val translations: Map> get() + + override val themeManager: ThemeManager get() + + override val rqesServiceConfig: RqesServiceConfig get() + + override val qtsps: List get() + + override val printLogs: Boolean get() +} ``` -The application's IACA certificates are located [here](https://github.com/eu-digital-identity-wallet/eudi-app-android-wallet-ui/tree/main/resources-logic/src/main/res/raw): +Example: + +``` +class RQESConfigImpl : EudiRQESUiConfig { + + override val rqesServiceConfig: RqesServiceConfig + get() = RqesServiceConfig( + clientId = "your_clientid", + clientSecret = "your_secret", + authFlowRedirectionURI = URI.create(your_uri), + signingAlgorithm = your_algo, + hashAlgorithm = your_algo, + ) + + override val qtsps: List + get() = listOf( + QtspData( + name = "your_name", + endpoint = "your_endpoint".toUri(), + scaUrl = "your_sca", + ) + ) + + override val printLogs: Boolean get() = BuildConfig.DEBUG +} +``` ## DeepLink Schemas configuration