SimplePresentmentSource

class SimplePresentmentSource(val documentStore: DocumentStore, val documentTypeRepository: DocumentTypeRepository, val zkSystemRepository: ZkSystemRepository? = null, val eventLogger: EventLogger? = null, val requesterHistory: RequesterHistory? = null, getFaceMatcherFn: () -> FaceMatcher? = { null }, resolveTrustFn: suspend (requester: Requester) -> TrustedRequesterIdentity? = { null }, showConsentPromptFn: ShowConsentPromptFn = ::promptModelRequestConsent, getBadgesFn: suspend (document: Document) -> List<DocumentBadge> = { document -> emptyList() }, getFaceMatchingModeFn: suspend (credential: Credential, requesterIdentities: List<RequesterIdentity>) -> FaceMatchingMode = { _, _ -> FaceMatchingMode.ONLY_IF_REQUESTED }, val preferSignatureToKeyAgreement: Boolean = true, val domainsMdocSignature: List<String> = emptyList(), val domainsMdocKeyAgreement: List<String> = emptyList(), val domainsKeylessMdoc: List<String> = emptyList(), val domainsKeylessSdJwt: List<String> = emptyList(), val domainsKeyBoundSdJwt: List<String> = emptyList()) : PresentmentSource

An implementation of PresentmentSource for when using ISO mdoc and IETF SD-JWT VC credentials.

This implementation assumes that Credentials for a Document are organized by domain corresponding to the type of credential.

Constructors

Link copied to clipboard
constructor(documentStore: DocumentStore, documentTypeRepository: DocumentTypeRepository, zkSystemRepository: ZkSystemRepository? = null, eventLogger: EventLogger? = null, requesterHistory: RequesterHistory? = null, getFaceMatcherFn: () -> FaceMatcher? = { null }, resolveTrustFn: suspend (requester: Requester) -> TrustedRequesterIdentity? = { null }, showConsentPromptFn: ShowConsentPromptFn = ::promptModelRequestConsent, getBadgesFn: suspend (document: Document) -> List<DocumentBadge> = { document -> emptyList() }, getFaceMatchingModeFn: suspend (credential: Credential, requesterIdentities: List<RequesterIdentity>) -> FaceMatchingMode = { _, _ -> FaceMatchingMode.ONLY_IF_REQUESTED }, preferSignatureToKeyAgreement: Boolean = true, domainsMdocSignature: List<String> = emptyList(), domainsMdocKeyAgreement: List<String> = emptyList(), domainsKeylessMdoc: List<String> = emptyList(), domainsKeylessSdJwt: List<String> = emptyList(), domainsKeyBoundSdJwt: List<String> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val documentStore: DocumentStore

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

the domains to use for KeyBoundSdJwtVcCredential instances, will be tried in order.

Link copied to clipboard

the domains to use for KeylessMdocCredential instances, will be tried in order.

Link copied to clipboard

the domains to use for KeylessSdJwtVcCredential instances, will be tried in order.

Link copied to clipboard

the domains to use for KeyBoundMdocCredential instances using mdoc MAC authentication, will be tried in order.

Link copied to clipboard

the domains to use for KeyBoundMdocCredential instances using mdoc ECDSA authentication, will be tried in order.

Link copied to clipboard
open override val eventLogger: EventLogger?

an EventLogger for logging events or null.

Link copied to clipboard

whether to use mdoc ECDSA authentication even if mdoc MAC authentication is possible (ISO mdoc only).

Link copied to clipboard

a RequesterHistory for tracking relying party interactions or null.

Link copied to clipboard

the ZkSystemRepository to use or null.

Functions

Link copied to clipboard
open suspend override fun getBadges(document: Document): List<DocumentBadge>

Gets a list of badges for a document.

Link copied to clipboard
open override fun getFaceMatcher(): FaceMatcher?

Gets the FaceMatcher to use for face matching during presentment, or null if face matching is not available.

Link copied to clipboard
open suspend override fun getFaceMatchingMode(credential: Credential, requesterIdentities: List<RequesterIdentity>): FaceMatchingMode

Determines whether and when to perform face matching for a credential presentation.

Link copied to clipboard
open suspend override fun resolveTrust(requester: Requester): TrustedRequesterIdentity?

Determines if a request comes from a trusted requestor and returns the information about the requestor.

Link copied to clipboard
open suspend override fun selectCredential(document: Document, requestedClaims: List<RequestedClaim>, keyAgreementPossible: List<EcCurve>, credential: Credential?, keyBindingRequired: Boolean): Credential?

Chooses a credential from a document.

Link copied to clipboard
open suspend override fun showConsentPrompt(requester: Requester, trustedRequesterIdentity: TrustedRequesterIdentity?, presentmentData: PresentmentData, preselectedDocuments: List<Document>, onDocumentsInFocus: (documents: List<Document>) -> Unit): PresentmentSelection?

A function to show a consent prompt.

Link copied to clipboard

Returns a PresentmentSource that delegates all operations to this instance except showConsentPrompt, which is handled by showConsentPromptFn.