You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm out of my depth here with the specifics of DID Document concepts, so stubbing this in and can go deeper later if warranted.
The basic idea being, it may be common place for a developer to obtain a fully-qualified DID key-id, for example in a JWT header's kid property, we may have did:dht:{things}#{key-id}, and want the obtain the full Public Key JWK from the given DID Document. In other words, "I have the key ID, but I need the full public key."
For example, in our jws.Verify() method we currently do this:
did, err:=_did.Parse(jws.Header.KID)
iferr!=nil {
returnerrors.New("malformed JWS header. kid must be a DID URL")
}
resolutionResult, err:=dids.Resolve(did.URI)
iferr!=nil {
returnfmt.Errorf("failed to resolve DID: %w", err)
}
vmSelector:=didcore.ID(did.URL)
verificationMethod, err:=resolutionResult.Document.SelectVerificationMethod(vmSelector)
iferr!=nil {
returnfmt.Errorf("kid does not match any verification method %w", err)
}
But this may be common-place outside of JWS. So, we could introduce a new function in the did package, something like this:
Originally thought of here https://github.com/TBD54566975/web5-go/pull/60/files/#r1502586768
I'm out of my depth here with the specifics of DID Document concepts, so stubbing this in and can go deeper later if warranted.
The basic idea being, it may be common place for a developer to obtain a fully-qualified DID key-id, for example in a JWT header's
kid
property, we may havedid:dht:{things}#{key-id}
, and want the obtain the full Public Key JWK from the given DID Document. In other words, "I have the key ID, but I need the full public key."For example, in our
jws.Verify()
method we currently do this:But this may be common-place outside of JWS. So, we could introduce a new function in the
did
package, something like this:(Not sure
didURL
would be the proper name)The text was updated successfully, but these errors were encountered: