CredentialPresenter

Trait CredentialPresenter 

Source
pub trait CredentialPresenter: Send + Sync {
    // Required methods
    fn format(&self) -> CredentialFormat;
    fn present(
        &self,
        credential_data: &[u8],
        disclosure: &DisclosureSelection,
        options: &PresentationOptions,
    ) -> Result<PresentedCredential>;
}
Expand description

Trait for creating credential presentations with selective disclosure.

Required Methods§

Source

fn format(&self) -> CredentialFormat

The credential format this presenter handles.

Source

fn present( &self, credential_data: &[u8], disclosure: &DisclosureSelection, options: &PresentationOptions, ) -> Result<PresentedCredential>

Create a presentation from a credential with selective disclosure.

Formats that don’t support predicates (SD-JWT, JWT-VC, mdoc) must return Err(CredentialError::UnsupportedPredicate) if the disclosure selection contains any ClaimDisclosure::Predicate entries.

§Arguments
  • credential_data - The serialized credential bytes
  • disclosure - Which claims to reveal, hide, or prove predicates about
  • options - Presentation options (nonce, audience, holder DID)

Implementors§