-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define an ISO mdoc profile for Digital Credential API in OIDF/DCP #219
Comments
Is this limited to DC API profile? I'm asking since underneath there most be a OID4VP for mdoc profile. Would this then be done in the DCP WG, too? |
What is required for the ISO mdoc-specific part is really just defining the |
what about the ISO specific identifiers and so, just what constitutes a profiles. |
It is a DCP WG decision if the requirements from the ISO WG can be included in the OID4VP DI API Annex already. |
Hereby a proposal for a profile that addresses the request from ISO SC17/WG10. It defines all details necessary to have a successful interaction when the wallet and relying party implement the mandatory requirements of this profile. The profile has been designed to implement the requirements applicable to the openid4vp protocol for the digital credentials API as defined in annex a. One of the open tasks before making a PR is to make sure it's WebIDL compatible. Making it WebIDL compatible could require making changes to the proposal. Request object It MUST have the following two elements: It MAY have the following element These elements have the following definitions: response_encryption response_encryption_paramaters type is an element that defines the response encryption type, for this profile the value MUST be “mdoc_profile_encryption_1”. verifier_authentications: This is an array of verifier_authentication. If present, it MUST contain at least one verifier_authentication. verifier_authentication: This is an array that MUST contain two elements, type and value. An example for verifier authentication are: type: “request_signature_example” Response The response structure is a dictionary that MUST have the following two elements: type (string) is an element that defines the response encryption type For this profile, type MUST be “mdoc_profile_encryption_1”. jwk contains the response encryption key of the verifier, the value MUST be a jwk as defined in RFC 7517 Note 1: It is still to be defined how the RP knows how to decode the elements in the vp_token array since that may be part of the update on the query language. Currently, this is implicit through the use of the profile parameter. The value of the encrypted_response shall be calculated by taking the CBOR encoded DeviceResponse and encrypting it with HPKE (RFC 9180) with the following parameters: Mode: Base The keys used are the Verifier and RP response encryption keys in the respective jwk elements.
|
@martijnharing thanks for sharing your proposal. I have to admit I don't understand how it fits into OID4VP. Can you please share request and response examples? |
@martijnharing just to follow up on the conversation in today's WG call, there's an example request that requests an encrypted response and has verifier authentication via the browser API here: https://openid.github.io/OpenID4VP/openid-4-verifiable-presentations-wg-draft.html#appendix-A.3.2 and the response just comes back as an encrypted JWE as per the second example here: https://openid.github.io/OpenID4VP/openid-4-verifiable-presentations-wg-draft.html#appendix-A.4 It's probably not super clear (for brevity the actual signed jwt request and encrypted jwe aren't shown in full), and the request for encryption is a combination of the response mode with jwt and the jwks with a |
As I tried to acknowledge on the call yesterday, I suspect it is rather confusion for someone coming to this without familiarity with the many layers of OAuthy stuff that's been built on here. And effectively a first draft at a profile for the W3C Digital Credentials API that is building further on that. But as @jogu says, a request for encryption is conveyed with with a response mode of |
Hereby an example, all the cryptographic structures should be correct as well
Based on the comments a few changes are made: This example uses the updated request structure that's currently under development. It also uses the 'verifier_authentication_example' mechanism, that allows to authenticate the verifier (through its key material), without needing to sign the full request (including the vp_query), which was discussed at IIW as one of the mechanisms to be supported. |
Hi Martijn Thanks! It might be worth thinking about how we progress this. In particular I think it's likely that anything that isn't mdoc specific (e.g. adding a new way to authenticate the verifier) should be split out into a separate issue that can investigate if that mechanism should be added to the browser API appendix and/or the core of OID4VP. I'm not clear why The mdoc profile itself should only build on top of what is already in the rest of the standard, specifying how to use the existing standard with mdoc - i.e. not specifying new behaviours unless they're dealing with an mdoc-specific problem. |
Thanks for the suggestion, indeed if there are parts of the requirements and definitions that are in the profile proposal that instead should go in the browser-api annex itself then that's of course just as good (or even better). In order to make a concrete separate issue, which parts of the profile should those be exactly? On the response_mode, the current text says: |
vp_query_info, response_encryption, response_encryption_parameters, verifier_authentications, type, jwt, are all features that duplicate existing openid4vp features and should be separate from mso_mdoc profile of the browser API profile of openid4vp. sentences like JARM is defined separately from any redirects, so w3c_dc_api.jwt is the response_mode to use when returning encrypted responses over the browser API. |
Discussed in a WG call, agreed that next steps are to go back to smaller questions that led to the proposal such as those below (not capturing all of those, and my wording might not be accurate):
so that we can start clarifying things in the spec for things that are already defined but are not clear enough. also discussed that these things probably need to be fixed in general in the spec (outside the mdoc profile) |
Hereby some further explanation for those questions, some possible ways forward and explanations for the choices made in the proposals. For item 1, "how to pass an encryption key in a trusted way in an unsigned request". This is mentioned in the WG10 ask as:
This means that we need to authenticate the information used for response encryption and transaction security. In the context of OpenID4VP, this includes the jwk for response encryption, the response encryption cryptographic requirements (e.g. algorithm, encryption profile etc), the nonce, and (if present) the expected origin. The proposal does not use JAR for a few reasons, an important one being that JAR requires the full structure to be signed. This means that it's not possible to only sign the response encryption information (i.e. the query-language structure must always be signed as well). In the proposal the authentication is done by signing the "response_encryption_paramaters" structure. This intermediate structure was used to facilitate signing the correct information but means a regrouping of the OpenID elements like nonce and jwks, which is not the preferred direction as indicated by the group. The other downside of this approach is that it this doesn't work well with the requirement for the elements to be encoded as WebIDL elements. If that's possible, we can include the values of nonce, jwks, response encryption parameters, client_id, client_id_scheme, the response encryption parameters and the vp_query directly in the data to be signed structure for the verifier_authentication structure. This would also mean that we can include all of these parameters in the same way as is currently defined for the authorization_request, instead of needing the 2 new vp_query_info and response_encryption parameters. Issue#92 was mentioned, but that seems to address a different issue than the problem of authenticating the encryption information. For item 3 "what if verifier wants to pass multiple trust models, hoping one is supported by the wallet?" This is implicitly mentioned in the WG10 ask since the 18013-5 request structure supports multiple RP authentication signatures. Not having the ability to support multiple RP authentication signatures would mean that it's not possible to request documents that use different trust models, or request documents from issuers (e.g. regions) that have different trust models. Not having those abilities would be a significant limitation of the protocol. Most of the consequences and possible solutions are similar to the ones mentioned in item 1, since having multiple RP authentication signatures seems to not be supported by the JAR specification. The proposal addresses this by defining an array of verifier_authentication elements, each of which can contain a signature for a trust model. As the elements that are signed by these structures is dynamic (see item 1), this mechanism supports both the scenario of signing the encryption information, as well as also signing the vp_query. For item 2, "which JARM response mode to use to return encryption response over the browser api" Annex A mentions that "[..] w3c_dc_api.jwt when the response is signed and/or encrypted as defined in Section 6.3." If the intention of Annex A is to use the JARM specification, but to use a different response mode mechanisms that uses the browser api for transmission, we would also have to address a number of requirements in the JARM spec that are either not applicable or can have adverse effects in the context of using the browser api. The proposal performs the response encryption using just 2 parameters in the response: the key used for encryption and the encrypted blob itself. Using the optional JARM mechanism to provide the encryption would mean duplicating algorithm information (e.g. the exact HPKE mode, the encryption profile) which seems to result in a more complex structure to implement and verify than what's currently proposed. |
Apologies @martijnharing, some of my inability to understand the resistance to JARM and attachment to HPKE in this issue came through at the end of the call when the different #216 was being discussed. Hopefully the clarifications that @selfissued offered to make there will be helpful in this context too. |
This proposal is based on a discussion with @jogu @martijnharing @awoie @danielfett @bc-pi: We would like to omit canonicalization of the request, that's why the basis of the proposal is to use the multi signature feature provided by the JWS JSON Serialization. The OID4VP request
would not contain
Every "signatures" object has the additional data for a certain RP authentication credential (protected or unprotected). Open Questions:
|
I've split the multiple RP authentication part out into issue #248 as it seems to be more generally applicable. (We should probably create issues for any other generally applicable parts.) |
Agreed on today's call that Martijn could open a PR. |
While that is true, it was at the very end of the call at a point that I suspect many participants had lost the will to try to contribute. I can say with some certainty that that's where I was at that point in the call. I can also say with some certainty that it's not clear what that PR might entail. But I really hope that any such work will consider @jogu's very reasonable and appropriate comment from a month ago: "[that the] mdoc profile itself should only build on top of what is already in the rest of the standard, specifying how to use the existing standard with mdoc - i.e. not specifying new behaviours [behaviors] unless they're dealing with an mdoc-specific problem. [and even then considering if they are really mdoc-specific problems or just seem that way due to being viewed through an mdoc-specific lens]." |
Thanks @bc-pi. Yeah, sorry, my previous comment was probably overly brief, a side effect of trying to get through too much on yesterday's call. To record the other things I said on the call: The profile is expected to define things for interoperability like which |
Hopefully the thoughtful work that @selfissued did in #243 to clarify signing and encryption with JARM responses will help with any persistent misunderstanding that's occurred in this context. |
I talked privately with Martijn a bit more about this just to check we didn't have any unsettled items left but it looks like we still need to discuss the encryption mechanism more in the working group to reach a consensus, so I've moved this to 'discuss' status. |
discussed at IIW.
|
The scope of the HAIP specification is to provide a full set of requirements for the full life cycle (provisioning, presentment) of SD-JWT VC. It includes requirements on a large range of issues going way beyond what we need for mdoc, which is only how to use the DC-api profile of openid when you want to present an mdoc. |
can we move this discussion to #327 ? |
ISO/IEC SC17/JTC1 WG10 had an in-person meeting in Korea in late June where a demo of the Digital Credentials API was provided (also including cross-device). WG10 asked OIDF if they can help with the following:
As a member of WG10 (I'm not speaking on their behalf) and OIDF/DCP, I would support this ask, especially to facilitate harmonization between OIDF and ISO.
Before jumping into the detailed requirements and how to address them, I think OIDF/DCP should think about: 1) are we going to support this ask (I do), 2) and how to address this structurally. Structurally, it could be done in the following way but feedback welcome:
Option 1:
Option 2:
Beyond the above, we can think about harmonization between HAIP and this new mdoc-specific profile, especially wrt the Digital Credentials API profile which I assume HAIP will also want to make some choices in the future. But I see this not as something we necessarily have to decide right away.
@Sakurann @jogu @tlodderstedt @martijnharing @tplooker @paulbastian @GarethCOliver @davidz25 @sbahloul
The text was updated successfully, but these errors were encountered: