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§
Sourcefn format(&self) -> CredentialFormat
fn format(&self) -> CredentialFormat
The credential format this presenter handles.
Sourcefn present(
&self,
credential_data: &[u8],
disclosure: &DisclosureSelection,
options: &PresentationOptions,
) -> Result<PresentedCredential>
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 bytesdisclosure- Which claims to reveal, hide, or prove predicates aboutoptions- Presentation options (nonce, audience, holder DID)