Package-level declarations

Types

Link copied to clipboard
class AuthenticationFailedException(message: String, cause: Throwable? = null) : Exception

Thrown when user authentication (such as biometric or passphrase verification to unlock a key) fails or is canceled during presentment.

Link copied to clipboard
actual open class DocumentChooserData

Data for configuring a document chooser.

expect open class DocumentChooserData

Data used to configure the document chooser used in PresentmentModel.

actual open class DocumentChooserData

Not implemented for iOS at this point.

actual open class DocumentChooserData

Not implemented for JVM platform at this point.

actual open class DocumentChooserData

Not implemented for web-based platforms at this point.

Link copied to clipboard
data class EngagementParams(val eDeviceKey: EcPrivateKey, val deviceEngagement: DataItem, val handover: DataItem, val eReaderKey: EcPublicKey? = null, val eReaderKeyBytes: ByteString? = null)

Encapsulates the engagement parameters required for ISO/IEC 18013-5 presentment sessions.

Link copied to clipboard

Mode indicating whether and when face matching should be performed during credential presentment.

Link copied to clipboard
class FaceNotMatchedException(message: String, cause: Throwable? = null) : Exception

Thrown when face matching fails or is canceled by the user during presentment.

class Iso18013PresentmentNfcDisconnectedException(message: String = "Device was removed from reader before sharing completed") : Exception

Exception thrown when the device is removed from the reader before presentment can be completed.

Link copied to clipboard

Thrown if timed out waiting for a message from the remote reader.

Link copied to clipboard
data class Iso18013Response(val deviceResponse: DeviceResponse, val eventData: EventPresentmentData, val durationUserConsentAndAuth: Duration = Duration.ZERO, val durationResponseGeneration: Duration = Duration.ZERO)

The result of calling mdocPresentment.

Link copied to clipboard

Thrown when presentment was cancelled.

Link copied to clipboard

Thrown when it's not possible to satisfy the request.

Link copied to clipboard
data class PresentmentCredentialMatch(val credential: Credential, val claims: Map<RequestedClaim, Claim>, val source: PresentmentCredentialMatchSource, val transactionData: List<TransactionData<*>>, val transactionUserInput: Map<String, TransactionUserInput> = emptyMap(), val faceMatchNeeded: Boolean = false, val encryptionRequested: Boolean = false, val encryptionTargetCertificationChain: X509CertChain? = null, val encryptionTargetTrustMetadata: TrustMetadata? = null)

A match of a particular Credential from org.multipaz.document.DocumentStore for presentment.

Link copied to clipboard

Base class for source of a match.

Link copied to clipboard

ISO 18013-5 version for the source of a match.

OpenID4VP version for the source of a match.

Link copied to clipboard
data class PresentmentData(val useCases: List<PresentmentUseCase>)

Data for credential presentment.

Link copied to clipboard

A model which can be used to drive UI for presentment.

Link copied to clipboard

Outcome of a presentment session.

Link copied to clipboard

Protocol used for credential presentment.

Link copied to clipboard

Base class for a purpose hint in a PresentmentUseCase.

Link copied to clipboard
data class PresentmentPurposeHintIso18013(val controllerId: String, val purposeHintCode: Int) : PresentmentPurposeHint

ISO/IEC 18013-5 purpose hint for a PresentmentUseCase.

Link copied to clipboard
data class PresentmentSelection(val matches: List<PresentmentCredentialMatch>, val preloadedKeyUnlockData: List<KeyUnlockData> = emptyList())

A selection of credentials and claims from a PresentmentData.

Link copied to clipboard
abstract class PresentmentSource(val documentStore: DocumentStore, val documentTypeRepository: DocumentTypeRepository, val zkSystemRepository: ZkSystemRepository? = null, val eventLogger: EventLogger? = null, val requesterHistory: RequesterHistory? = null)

The source of truth used for credential presentment.

Link copied to clipboard
data class PresentmentTelemetry(val protocol: PresentmentProtocol, val engagementType: EngagementType? = null, val outcome: PresentmentOutcome, val warnings: List<TransportWarning> = emptyList(), val requesterInTrustList: Boolean? = null, val requestSizeBytes: Int? = null, val responseSizeBytes: Int? = null, val numRequestsServed: Int = 0, val numDocumentsPresented: Int = 0, val numNfcReTaps: Int = 0, val durationEngagementToConnected: Duration? = null, val durationConnectedToRequestReceived: Duration? = null, val durationUserConsentAndAuth: Duration? = null, val durationResponseGeneration: Duration? = null, val durationResponseTransmission: Duration? = null, val durationTotal: Duration? = null, val transportStats: MdocTransportStats? = null)

Anonymized, PII-free telemetry collected during a credential presentment session.

Link copied to clipboard

Thrown when timing out waiting for the reader to connect.

Link copied to clipboard
class PresentmentUnlockReason(val credential: Credential) : Reason

Value that conveys a request for a key in a SecureArea be unlocked in order to present a Credential to a Relying Party.

Link copied to clipboard
data class PresentmentUseCase(val optional: Boolean, val solutions: List<PresentmentUseCaseSolution>, val purposeHints: List<PresentmentPurposeHint> = emptyList(), val allowMultiple: Boolean = false)

A use-case which is part of a transaction.

Link copied to clipboard
data class PresentmentUseCaseSolution(val matches: List<PresentmentCredentialMatch>, val optionIndex: Int = 0)

A solution to a use-case.

Link copied to clipboard

Tracks past credential presentment interactions with relying parties (requesters).

Link copied to clipboard
data class RequesterHistoryEntry(val shareCount: Int, val firstSharedAt: Instant, val lastSharedAt: Instant)

Historical interaction record for a specific relying party (requester).

Link copied to clipboard
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.

Link copied to clipboard
class SimpleRequesterHistory(storage: Storage, partitionId: String = "default", clock: Clock = Clock.System) : RequesterHistory

An implementation of RequesterHistory backed by Storage.

Link copied to clipboard
class TransactionData<PayloadT : Any>(val type: TransactionType<PayloadT>, val payload: PayloadT, val protocol: TransactionProtocol, val rawBytes: ByteString, val hashAlgorithms: List<Algorithm>? = null)

An object that holds transaction data.

Link copied to clipboard
class TransactionDataContext(val transactionData: List<TransactionData<*>>, val requester: Requester, val trustedRequesterIdentity: TrustedRequesterIdentity?, val hasClaims: Boolean, val purposes: Set<PresentmentPurpose> = emptySet(), val userInput: TransactionUserInput?, val onUserInputChanged: (userInput: TransactionUserInput) -> Unit)

What an application's org.multipaz.prompt.TransactionDataRenderer needs to draw one type's items in the consent prompt.

Link copied to clipboard

Protocol through which transaction data was received.

Properties

Functions

Link copied to clipboard
fun classifyPresentmentException(error: Throwable, waitingForConnection: Boolean = false): PresentmentOutcome

Maps a Throwable thrown during presentment to a structured PresentmentOutcome.

Link copied to clipboard
suspend fun digitalCredentialsPresentment(protocol: String, data: String, appId: String?, origin: String, preselectedDocuments: List<Document>, source: PresentmentSource, onDocumentsInFocus: (documents: List<Document>) -> Unit = {}, onTelemetry: (telemetry: PresentmentTelemetry) -> Unit = {}): String
suspend fun digitalCredentialsPresentment(protocol: String, data: JsonObject, appId: String?, origin: String, preselectedDocuments: List<Document>, source: PresentmentSource, onDocumentsInFocus: (documents: List<Document>) -> Unit = {}, onTelemetry: (telemetry: PresentmentTelemetry) -> Unit = {}): JsonObject

Present credentials according to the W3C Digital Credentials API.

Link copied to clipboard
suspend fun Iso18013Presentment(transport: MdocTransport, engagementParams: StateFlow<EngagementParams>, source: PresentmentSource, keyAgreementPossible: List<EcCurve>, preselectedDocuments: List<Document> = emptyList(), insertSequenceNumbers: Boolean = false, timeout: Duration? = 15.seconds, timeoutSubsequentRequests: Duration? = 30.seconds, onWaitingForRequest: () -> Unit = {}, onWaitingForUserInput: () -> Unit = {}, onDocumentsInFocus: (documents: List<Document>) -> Unit = {}, onSendingResponse: () -> Unit = {}, onDeviceRequest: (deviceRequest: DeviceRequest) -> Unit = {}, onTelemetry: (telemetry: PresentmentTelemetry) -> Unit = {})

Performs proximity presentment according to ISO/IEC 18013-5:2021.

suspend fun Iso18013Presentment(transport: MdocTransport, eDeviceKey: EcPrivateKey, deviceEngagement: DataItem, handover: DataItem, source: PresentmentSource, keyAgreementPossible: List<EcCurve>, preselectedDocuments: List<Document> = emptyList(), insertSequenceNumbers: Boolean = false, timeout: Duration? = 15.seconds, timeoutSubsequentRequests: Duration? = 30.seconds, onWaitingForRequest: () -> Unit = {}, onWaitingForUserInput: () -> Unit = {}, onDocumentsInFocus: (documents: List<Document>) -> Unit = {}, onSendingResponse: () -> Unit = {}, onTelemetry: (telemetry: PresentmentTelemetry) -> Unit = {})

Performs proximity presentment according to ISO/IEC 18013-5:2021 using individual engagement parameters.

Link copied to clipboard
suspend fun Iso18013ReaderQrPresentment(uri: String, source: PresentmentSource, transportFactory: MdocTransportFactory = MdocTransportFactory.Default, options: MdocTransportOptions = MdocTransportOptions(), preferredConnectionMethodOrder: List<String> = emptyList(), bleDirectL2capEnabled: Boolean = true, supportedCurves: List<EcCurve> = Crypto.supportedCurves.filter { it.supportsKeyAgreement }, capabilities: Map<Capability, DataItem> = mapOf( Capability.READER_AUTH_ALL_SUPPORT to true.toDataItem(), Capability.EXTENDED_REQUEST_SUPPORT to true.toDataItem(), ), preselectedDocuments: List<Document> = emptyList(), connectionTimeout: Duration? = 15.seconds, timeout: Duration? = 15.seconds, timeoutSubsequentRequests: Duration? = 30.seconds, onConnecting: () -> Unit = {}, onWaitingForRequest: () -> Unit = {}, onWaitingForUserInput: () -> Unit = {}, onDocumentsInFocus: (documents: List<Document>) -> Unit = {}, onSendingResponse: () -> Unit = {}, onDeviceRequest: (deviceRequest: DeviceRequest) -> Unit = {}, onTelemetry: (telemetry: PresentmentTelemetry) -> Unit = {})

Performs holder-side proximity presentment using ISO/IEC 18013-5 Second Edition Reader QR engagement (clauses 9.7 and 12.2.4).

Link copied to clipboard
suspend fun mdocPerformFaceMatching(selection: PresentmentSelection, source: PresentmentSource, onWaitingForUserInput: () -> Unit = {}): List<Credential>

Performs face matching for credentials in selection according to the wallet policy.

Link copied to clipboard
suspend fun mdocPresentment(deviceRequest: DeviceRequest, eReaderKey: EcPublicKey?, sessionTranscript: DataItem, source: PresentmentSource, keyAgreementPossible: List<EcCurve>, requesterAppId: String?, requesterOrigin: String?, creationTime: Instant = Clock.System.now(), preselectedDocuments: List<Document> = emptyList(), onWaitingForUserInput: () -> Unit = {}, onDocumentsInFocus: (documents: List<Document>) -> Unit): Iso18013Response

Present ISO mdoc credentials according to ISO/IEC 18013-5:2021.

Link copied to clipboard

Authenticates the user for credentials in a PresentmentSelection and preloads their unlock data.

Link copied to clipboard
suspend fun mdocPresentmentGenerateResponse(selection: PresentmentSelection, deviceRequest: DeviceRequest, eReaderKey: EcPublicKey?, sessionTranscript: DataItem, source: PresentmentSource, requesterAppId: String? = null, requesterOrigin: String? = null, creationTime: Instant = Clock.System.now(), faceMatchedCredentials: List<Credential> = emptyList()): Iso18013Response

Generates the ISO mdoc presentment response given a user's PresentmentSelection.

Link copied to clipboard
suspend fun mdocPresentmentObtainConsent(deviceRequest: DeviceRequest, source: PresentmentSource, keyAgreementPossible: List<EcCurve> = emptyList(), requesterAppId: String? = null, requesterOrigin: String? = null, preselectedDocuments: List<Document> = emptyList(), onWaitingForUserInput: () -> Unit = {}, onDocumentsInFocus: (documents: List<Document>) -> Unit = {}): PresentmentSelection

Obtains user consent for ISO mdoc presentment according to ISO/IEC 18013-5:2021.

Link copied to clipboard
suspend fun uriSchemePresentment(source: PresentmentSource, uri: String, appId: String?, origin: String?, httpClientEngineFactory: HttpClientEngineFactory<*>, onDocumentsInFocus: (documents: List<Document>) -> Unit = {}, onTelemetry: (telemetry: PresentmentTelemetry) -> Unit = {}): String?

Present credentials according to OpenID4VP 1.0 w/ URI schemes.