generated from TBD54566975/tbd-project-template
-
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
Update @web5/credentials
README
#349
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nitro-neal
requested review from
frankhinek,
csuwildcat and
mistermoe
as code owners
December 11, 2023 21:23
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
TBDocs Report ✅ No errors or warnings @web5/api
TBDocs Report Updated at 2023-12-13T19:33:12Z |
yo @nitro-neal ! i think we're missing an |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #349 +/- ##
==========================================
- Coverage 92.80% 92.73% -0.07%
==========================================
Files 76 71 -5
Lines 17267 16473 -794
Branches 1607 1521 -86
==========================================
- Hits 16025 15277 -748
+ Misses 1215 1174 -41
+ Partials 27 22 -5
|
frankhinek
suggested changes
Dec 12, 2023
frankhinek
changed the title
Update
Update Dec 13, 2023
@web5/crypto
README@web5/credentials
README
Co-authored-by: Frank Hinek <[email protected]>
Co-authored-by: Frank Hinek <[email protected]>
Co-authored-by: Frank Hinek <[email protected]>
Co-authored-by: Frank Hinek <[email protected]>
Co-authored-by: Frank Hinek <[email protected]>
Co-authored-by: Frank Hinek <[email protected]>
Co-authored-by: Frank Hinek <[email protected]>
frankhinek
approved these changes
Dec 13, 2023
mistermoe
approved these changes
Dec 13, 2023
finn-block
pushed a commit
that referenced
this pull request
Mar 19, 2024
* update readme * updates * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/tests/presentation-exchange.spec.ts Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/tests/presentation-exchange.spec.ts Co-authored-by: Frank Hinek <[email protected]> * minor readme updates --------- Co-authored-by: Frank Hinek <[email protected]> Co-authored-by: Moe Jangda <[email protected]>
finn-block
pushed a commit
that referenced
this pull request
Mar 19, 2024
* update readme * updates * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/tests/presentation-exchange.spec.ts Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/tests/presentation-exchange.spec.ts Co-authored-by: Frank Hinek <[email protected]> * minor readme updates --------- Co-authored-by: Frank Hinek <[email protected]> Co-authored-by: Moe Jangda <[email protected]>
finn-block
pushed a commit
that referenced
this pull request
Mar 19, 2024
* update readme * updates * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/README.md Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/tests/presentation-exchange.spec.ts Co-authored-by: Frank Hinek <[email protected]> * Update packages/credentials/tests/presentation-exchange.spec.ts Co-authored-by: Frank Hinek <[email protected]> * minor readme updates --------- Co-authored-by: Frank Hinek <[email protected]> Co-authored-by: Moe Jangda <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Credentials
The Credentials package enables the creation, signing, verification, and general processing of
Verifiable Credentials
(VCs). It also has fullPresentation Exchange
support.Verifiable Credential
Features
VerifiableCredential
instances.Usage:
Creating a Verifiable Credential
Create a new
VerifiableCredential
with the following parameters:type
: Type of the credential.issuer
: Issuer URI.subject
: Subject URI.data
: Credential data.expirationDate?
: (optinal) Expiration DateSigning a Verifiable Credential
Sign a
VerifiableCredential
with a DID:did
: The did that is signing the VCFirst create a
Did
object as follows:Then sign the VC using the
did
objectVerifying a Verifiable Credential
Verify the integrity and authenticity of a Verifiable Credential
vcJwt
: The VC in JWT format as a String.Parsing a JWT into a Verifiable Credential
Parse a JWT into a
VerifiableCredential
instancevcJwt
: The VC JWT as a String.Presentation Exchange
PresentationExchange
is designed to facilitate the creation of a Verifiable Presentation by providing tools to select and validate Verifiable Credentials against defined criteria.Features
Usage
Selecting Credentials
Select Verifiable Credentials that meet the criteria of a given presentation definition.
vcJwts
: The list of Verifiable Credentials to select from.presentationDefinition
The Presentation Definition to match against.This returns a list of the vcJwts that are acceptable in the presentation definition.
Satisfying a Presentation Definition
Validate if a Verifiable Credential JWT satisfies the given presentation definition. Will return an error if the evaluation results in warnings or errors.
vcJwts
: The list of Verifiable Credentials to select from.presentationDefinition
The Presentation Definition to match against.Create Presentation From Credentials
Creates a presentation from a list of Verifiable Credentials that satisfy a given presentation definition. This function initializes the Presentation Exchange (PEX) process, validates the presentation definition, evaluates the credentials against the definition, and finally constructs the presentation result if the evaluation is successful.
vcJwts
: The list of Verifiable Credentials to select from.presentationDefinition
The Presentation Definition to match against.Validate Definition
This method validates whether an object is usable as a presentation definition or not.
presentationDefinition
The Presentation Definition to validateValidate Submission
This method validates whether an object is usable as a presentation submission or not.
presentationSubmission
The Presentation Submission to validateValidate Presentation
Evaluates a presentation against a presentation definition.
presentationDefinition
The Presentation Definition to validatepresentation
The Presentation