Update Readme for credentials package #265
Merged
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:signOptions
: The sign options used to sign the credential.First create a SignOptions object as follows:
Then sign the VC using the signoptions object
Verifying a Verifiable Credential
Verify the integrity and authenticity of a VC JWT
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.
Validate Submission
This method validates whether an object is usable as a presentation submission or not.
Validate Presentation
Evaluates a presentation against a presentation definition.