-
Notifications
You must be signed in to change notification settings - Fork 57
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
adding vc create #148
adding vc create #148
Conversation
Codecov Report
@@ Coverage Diff @@
## main #148 +/- ##
==========================================
- Coverage 82.28% 81.59% -0.70%
==========================================
Files 68 68
Lines 6814 6992 +178
Branches 566 580 +14
==========================================
+ Hits 5607 5705 +98
- Misses 1205 1282 +77
- Partials 2 5 +3
|
@@ -280,6 +322,54 @@ export class Web5UserAgent implements Web5Agent { | |||
return { message: dwnMessage.toJSON(), dataStream: readableStream }; | |||
} | |||
|
|||
|
|||
// TODO: have issuer did key already stored in key manager and use that instead of generating a new one |
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.
You got it -- you'd want to reference the key that's already stored.
Worth noting that there's a convention we've been using for signing DWN messages and encrypting DWN records, which is noted here:
- https://github.com/TBD54566975/web5-js/blob/d8e2be7380e1ad504e7467d990dd942cead04ee5/packages/dids/src/types.ts#L61-L66
- https://github.com/TBD54566975/web5-js/blob/d8e2be7380e1ad504e7467d990dd942cead04ee5/packages/dids/src/did-ion.ts#L175-L182
To simplify we're going to combine messageAuthorizationKeys
and messageAttestationKeys
to messageSigningKeys
since the same key can be used for both. Attestation is an option for a message if the author wants non-repudiable attestation. For now, you can resolve the DID document of the other, get the service endpoints using getServices()
from the dids
package and use the first index in the messageAuthorizationKeys
array as the key reference to ask the KeyManager
to sign with.
Merging this will come after @frankhinek 's agent PR |
Super outdated, closing. Feel free to refresh and reopen. |
This change allows for a VC to be created with default values. Only the credentialSubject is required to create a credential
credentialSubject: any
- the json object of the credentialSubject fieldoptions?: CreateOptions
- this will be the options for the other fields that consist of a VerifiableCredential like(“@context”, status, subject, expirationDate, id, issuanceDate, issuer, type, etc.)Record
of the saved VC and the vc data object itselfNote: