PresentmentSource

abstract class PresentmentSource(val documentStore: DocumentStore, val documentTypeRepository: DocumentTypeRepository, val zkSystemRepository: ZkSystemRepository? = null)

The source of truth used for credential presentment.

This is used whenever an application wishes to present credentials including the DocumentStore which holds credentials that can be presented and a DocumentTypeRepository which contains descriptions of well-known document types which may be shown in a consent prompt.

It's also used for more dynamic data such as determining whether the requester is trusted (via resolveTrust) and if so what branding to show, whether user consent should be obtained or if preconsent exists (via showConsentPrompt), and even what kind of user authentication to perform to present the credential, if any (by picking a Credential from an appropriate domain in selectCredential).

See also

for one concrete implementation tailored for ISO mdoc and IETF SD-JWT VC credentials.

Inheritors

Constructors

Link copied to clipboard
constructor(documentStore: DocumentStore, documentTypeRepository: DocumentTypeRepository, zkSystemRepository: ZkSystemRepository? = null)

Properties

Link copied to clipboard

the DocumentStore which holds credentials that can be presented.

Link copied to clipboard

a DocumentTypeRepository which holds metadata for document types.

Link copied to clipboard

a ZkSystemRepository with ZKP systems or null.

Functions

Link copied to clipboard
abstract suspend fun resolveTrust(requester: Requester): TrustMetadata?

Determines if a requester is trusted.

Link copied to clipboard
abstract suspend fun selectCredential(document: Document, requestedClaims: List<RequestedClaim>, keyAgreementPossible: List<EcCurve>): Credential?
abstract suspend fun selectCredential(document: Document?, request: Request, keyAgreementPossible: List<EcCurve>): Credential?

Chooses a credential from a document.

Link copied to clipboard
abstract suspend fun showConsentPrompt(requester: Requester, trustMetadata: TrustMetadata?, credentialPresentmentData: CredentialPresentmentData, preselectedDocuments: List<Document>, onDocumentsInFocus: (documents: List<Document>) -> Unit): CredentialPresentmentSelection?

A function to show a consent prompt.