Package web5.sdk.vc.pex
Class PresentationDefinition
-
- All Implemented Interfaces:
public final class PresentationDefinitionRepresents a DIF Presentation Definition.
The
PresentationDefinitionoutlines the criteria that Verifiable Credentials (VCs) must meet for a presentation exchange. It includes input descriptors, submission requirements, and additional metadata.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringidprivate final Stringnameprivate final Stringpurposeprivate final List<InputDescriptor>inputDescriptorsprivate final List<SubmissionRequirement>submissionRequirements
-
Constructor Summary
Constructors Constructor Description PresentationDefinition(String id, String name, String purpose, List<InputDescriptor> inputDescriptors, List<SubmissionRequirement> submissionRequirements)
-
Method Summary
Modifier and Type Method Description final StringgetId()The unique identifier for the Presentation Definition. final StringgetName()The name of the Presentation Definition (optional). final StringgetPurpose()The purpose of the Presentation Definition (optional). final List<InputDescriptor>getInputDescriptors()A list of input descriptors that define the criteria for acceptable VCs. final List<SubmissionRequirement>getSubmissionRequirements()A list of submission requirements (optional). final List<String>selectCredentials(List<String> vcJwts)Selects Verifiable Credentials (VCs) that match the input descriptors of the Presentation Definition. final PresentationResultcreatePresentationFromCredentials(List<String> vcJwts)Creates a presentation submission from the selected Verifiable Credentials (VCs). -
-
Constructor Detail
-
PresentationDefinition
PresentationDefinition(String id, String name, String purpose, List<InputDescriptor> inputDescriptors, List<SubmissionRequirement> submissionRequirements)
-
-
Method Detail
-
getPurpose
final String getPurpose()
The purpose of the Presentation Definition (optional).
-
getInputDescriptors
final List<InputDescriptor> getInputDescriptors()
A list of input descriptors that define the criteria for acceptable VCs.
-
getSubmissionRequirements
final List<SubmissionRequirement> getSubmissionRequirements()
A list of submission requirements (optional).
-
selectCredentials
final List<String> selectCredentials(List<String> vcJwts)
Selects Verifiable Credentials (VCs) that match the input descriptors of the Presentation Definition.
- Parameters:
vcJwts- A list of VC JWTs to validate against the input descriptors.- Returns:
A list of VC JWTs that satisfy the input descriptors.
-
createPresentationFromCredentials
final PresentationResult createPresentationFromCredentials(List<String> vcJwts)
Creates a presentation submission from the selected Verifiable Credentials (VCs).
- Parameters:
vcJwts- A list of VC JWTs to create the presentation from.- Returns:
A
PresentationResultcontaining the presentation submission and matched VCs.
-
-
-
-