vc-data-model
vc-data-model copied to clipboard
Pin down the input type of securing mechanisms
https://w3c.github.io/vc-data-model/#securing-mechanism-specifications says
A securing mechanism's verification algorithm MUST provide an interface that receives inputs of a media type (string inputMediaType) paired with either a sequence of bytes (byte sequence inputBytes) or a document (map inputDocument)
Does this require that the securing mechanisms accept whichever of byte-sequence or map their caller wants to provide, or does it require the caller to send whichever the securing mechanism prefers? If the latter, how does the caller figure out which one the mechanism prefers, since that's not included in the associated registry?
It's the latter, and the presumption here is that human readable documentation for the cryptosuite library clearly defines what input types it supports. I could add a comment to that effect (and try to figure out how to align the input options so they're used in the algorithms), but at this point, I'm questioning if we should just say that it's up to the library author to pick one or both and understanding what the library supports is implementation specific and requires the implementer to read the library documentation?
Thoughts on what you'd prefer here, @jyasskin?
If you handle #1518 by parsing to an Infra map early, then I think it's easiest to have the securing specs take that map. Otherwise, you could have the call sites in this spec include something like "if the securing mechanism expects bytes, pass theBytes, otherwise pass the result of [=parsing JSON bytes to an Infra value=] given theBytes".
If you handle #1518 by parsing to an Infra map early, then I think it's easiest to have the securing specs take that map.
I don't think we can do this since we have some securing mechanisms (JOSE and COSE) that take opaque bytes as input to their securing mechanism (i.e., not parseable as JSON).
Otherwise, you could have the call sites in this spec include something like "if the securing mechanism expects bytes, pass theBytes, otherwise pass the result of [=parsing JSON bytes to an Infra value=] given theBytes".
Yes, good, this is what I was hoping to do. Thank you for reaffirming that doing so will work for you. PR incoming.
PR #1522 has been raised to address this issue. This issue will be closed once PR #1522 has been merged.
The issue was discussed in a meeting on 2024-07-17
- no resolutions were taken
View the transcript
3.4. Pin down the input type of verification algorithms (issue vc-data-model#1517)
See github issue vc-data-model#1517.
Brent Zundel: Part of our edits over the last year were to refine the algorithm for verification. This is further iteration on that.
… PR 1522 is response to the issue.
Manu Sporny: it's really just editorial.
… I just need to figure out how to do what he wants us to do.
Brent Zundel: where's the PR that puts it somewhere else?
Manu Sporny: 1523. We merged that.
… I need to check with Jeffrey about closing.
… he raised two issues, but maybe we addressed it with 1523.
PR #1522 has been merged, closing.