-
Notifications
You must be signed in to change notification settings - Fork 16
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
VCR: JWT support for credentials and presentations #2520
Conversation
Weirdness; with a VP from the Sphereon Wallet, the signer of the VP is a did:key, but the holder of the contained credential is a did:jwt. So the presenter is not the holder. Weird? JWT VP:
|
did:key and did:jwk are both a did representation of a public key, so they could refer to the same public key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gerardsn mentioned that it's still unclear if the jwt formats are called jwt_vc
or jwt_vc_json
. Maybe we should be able to accept both?
if keyID != "" && strings.Split(keyID, "#")[0] != credential.Issuer.String() { | ||
return errVerificationMethodNotOfIssuer | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only validation that needs to be done according to spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec does not even state this (it vaguely hints it could do something like this), but we do it for JSON-LD, do we should do the same for JWT to avoid confusion (leading to vulnerabilities)
I decoded and compared both, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tests are failing though |
0b614f9
to
175d83e
Compare
8218a6f
to
f96ada5
Compare
This PR adds support for creating and verifying VCs and VPs in JWT format.
TODO:
Requires nuts-foundation/go-did#87
Part of #2451
Note on VC/VP-JWT
The VC data model v1 specification of JWTs makes implementations complex:
iss
v.s.vc.issuer
), this leads to unspecified behavior when both are present.This leads to interpretation of individual software vendors or the creation of profiles (https://identity.foundation/jwt-vc-presentation-profile/). However, given the current capabilities and target use of the Nuts node, we can safely address these:
kid
header fordid:nuts
anddid:web
. Make an exception fordid:jwk
: it holds a single key, so it can be derived from theiss
JWT claim (appending#0
).VC data model v2
VC data model v2 (which is in draft) reworks JWT encoding through https://w3c.github.io/vc-jose-cose/. Although this specification is more explicit and thus should be easier to implement, it is still in draft. So we should stick with VC data model v1 JWT of things (we also don't support VCs in v2 format).
Compatibility
Regarding compatibility: it Sphereon produces JWT VCs that seem compatible with both v1 and v2 (for v1 it includes the
vc
claim, and for v2 it puts the VC properties directly inside the JWT claims (duplication)).