-
Notifications
You must be signed in to change notification settings - Fork 54
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
Get Key from a DID's Verification Information #342
Conversation
decentralgabe
commented
Apr 7, 2023
- Already existed in a lesser from in the service, this will be uptaken there
did/util.go
Outdated
|
||
for _, method := range verificationMethods { | ||
methodID := method.ID | ||
maybeKID1 := kid // the kid == the kid |
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.
a helper function may make these look nicer
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.
added
did/util.go
Outdated
// resolution will fail. | ||
// A KID can be fully qualified (e.g. did:example:123#key-1) or just the fragment (e.g. key-1, #key-1) | ||
// Some DIDs, like did:key, use the entire DID as the KID, so we need to handle all three cases. | ||
func GetKeyFromVerificationInformation(did Document, kid string) (gocrypto.PublicKey, error) { |
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.
Very cool, much needed!
Codecov Report
@@ Coverage Diff @@
## main #342 +/- ##
==========================================
+ Coverage 57.32% 57.48% +0.16%
==========================================
Files 51 51
Lines 6232 6298 +66
==========================================
+ Hits 3572 3620 +48
- Misses 1983 1998 +15
- Partials 677 680 +3
|