From a8a0a381cb45b0fce63fe56f542feeda115f3662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bu=C4=8D=C3=ADk=20Dominik=20Franti=C5=A1ek?= Date: Thu, 22 Aug 2024 17:22:49 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Allow=20JWS=20location?= =?UTF-8?q?=20for=20PreRegistered=20clients?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow specifying JWS algorithm and location of the JWKs for pre-registered clients. --- .../java/eu/europa/ec/eudi/wallet/internal/OpenId4VpUtils.kt | 4 +--- .../ec/eudi/wallet/transfer/openId4vp/OpenId4VpConfig.kt | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wallet-core/src/main/java/eu/europa/ec/eudi/wallet/internal/OpenId4VpUtils.kt b/wallet-core/src/main/java/eu/europa/ec/eudi/wallet/internal/OpenId4VpUtils.kt index 24be90bc..6ef511fa 100644 --- a/wallet-core/src/main/java/eu/europa/ec/eudi/wallet/internal/OpenId4VpUtils.kt +++ b/wallet-core/src/main/java/eu/europa/ec/eudi/wallet/internal/OpenId4VpUtils.kt @@ -150,9 +150,7 @@ internal object OpenId4VpUtils { verifier.clientId to PreregisteredClient( verifier.clientId, verifier.legalName, - JWSAlgorithm.RS256 to ByReference( - URI("${verifier.verifierApi}/wallet/public-keys.json") - ) + verifier.jwsAlgorithm to verifier.jwkSetSource ) } ) diff --git a/wallet-core/src/main/java/eu/europa/ec/eudi/wallet/transfer/openId4vp/OpenId4VpConfig.kt b/wallet-core/src/main/java/eu/europa/ec/eudi/wallet/transfer/openId4vp/OpenId4VpConfig.kt index 22f17f1d..9ea1c128 100644 --- a/wallet-core/src/main/java/eu/europa/ec/eudi/wallet/transfer/openId4vp/OpenId4VpConfig.kt +++ b/wallet-core/src/main/java/eu/europa/ec/eudi/wallet/transfer/openId4vp/OpenId4VpConfig.kt @@ -18,9 +18,12 @@ package eu.europa.ec.eudi.wallet.transfer.openId4vp +import com.nimbusds.jose.JWSAlgorithm import eu.europa.ec.eudi.openid4vp.DefaultHttpClientFactory +import eu.europa.ec.eudi.openid4vp.JwkSetSource import io.ktor.client.* import io.ktor.client.plugins.logging.* +import java.net.URI /** * Configuration for the OpenId4Vp transfer. @@ -186,6 +189,8 @@ data class PreregisteredVerifier( var clientId: ClientId, var legalName: LegalName, var verifierApi: VerifierApi, + var jwsAlgorithm: JWSAlgorithm = JWSAlgorithm.RS256, + var jwkSetSource: JwkSetSource = JwkSetSource.ByReference(URI("$verifierApi/wallet/public-keys.json")) ) typealias ClientId = String