Skip to content

Commit

Permalink
OpenID4VP: Use correct format for SD-JWT metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
nodh committed Jan 16, 2025
1 parent 4d830a8 commit 1181e1f
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ class OpenId4VpVerifier(

private val responseParser = ResponseParser(jwsService, verifierJwsService)
private val timeLeeway = timeLeewaySeconds.toDuration(DurationUnit.SECONDS)
private val containerJwt =
FormatContainerJwt(algorithmStrings = verifierJwsService.supportedAlgorithms.map { it.identifier })
private val supportedAlgorithms = verifierJwsService.supportedAlgorithms.map { it.identifier }
private val containerJwt = FormatContainerJwt(algorithmStrings = supportedAlgorithms)
private val containerSdJwt = FormatContainerSdJwt(
algorithmStrings = supportedAlgorithms.toSet(),
sdJwtAlgorithmStrings = supportedAlgorithms.toSet(),
kbJwtAlgorithmStrings = supportedAlgorithms.toSet()
)

/**
* Serve this result JSON-serialized under `/.well-known/jar-issuer`
Expand Down Expand Up @@ -91,7 +96,7 @@ class OpenId4VpVerifier(
vpFormats = FormatHolder(
msoMdoc = containerJwt,
jwtVp = containerJwt,
jwtSd = containerJwt,
jwtSd = containerSdJwt,
)
)
}
Expand Down Expand Up @@ -304,7 +309,7 @@ class OpenId4VpVerifier(

private fun RequestOptionsCredential.toFormatHolder() = when (representation) {
ConstantIndex.CredentialRepresentation.PLAIN_JWT -> FormatHolder(jwtVp = containerJwt)
ConstantIndex.CredentialRepresentation.SD_JWT -> FormatHolder(jwtSd = containerJwt)
ConstantIndex.CredentialRepresentation.SD_JWT -> FormatHolder(jwtSd = containerSdJwt)
ConstantIndex.CredentialRepresentation.ISO_MDOC -> FormatHolder(msoMdoc = containerJwt)
}

Expand Down

0 comments on commit 1181e1f

Please sign in to comment.