DocumentProvisioningHandler

class DocumentProvisioningHandler(val secureArea: SecureArea, val documentStore: DocumentStore, val mdocCredentialDomain: String = "mdoc_user_auth", val sdJwtCredentialDomain: String = "sdjwt_user_auth", val keylessCredentialDomain: String = "sdjwt_keyless", val batchSize: Int = 3, val metadataHandler: DocumentProvisioningHandler.AbstractDocumentMetadataHandler? = null) : AbstractDocumentProvisioningHandler

Implementation of AbstractDocumentMetadataHandler suitable for most uses.

TODO: integrate with credential replacement logic

Parameters

secureArea

credentials will be bound to keys from this SecureArea

documentStore

new Document will be created in this DocumentStore

mdocCredentialDomain

credential domain for (key-bound) ISO mdoc credentials

sdJwtCredentialDomain

credential domain for key-bound IETF SD-JWT credentials

keylessCredentialDomain

credential domain for keyless IETF SD-JWT credentials

batchSize

number of key-bound credentials to request in one batch (but not exceeding issuer-imposed limit)

metadataHandler

interface that initializes and updates document metadata; it may be provided if DocumentStore uses an AbstractDocumentMetadata factory (see DocumentStore.Builder.setDocumentMetadataFactory).

Constructors

Link copied to clipboard
constructor(secureArea: SecureArea, documentStore: DocumentStore, mdocCredentialDomain: String = "mdoc_user_auth", sdJwtCredentialDomain: String = "sdjwt_user_auth", keylessCredentialDomain: String = "sdjwt_keyless", batchSize: Int = 3, metadataHandler: DocumentProvisioningHandler.AbstractDocumentMetadataHandler? = null)

Types

Link copied to clipboard

Manager document metadata when the document is created and when the metadata is updated from the server.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun cleanupCredentialsOnError(pendingCredentials: List<Credential>, err: Throwable)

Clean up after failed not-initial (e.g. credential refresh) provisioning.

Link copied to clipboard
open suspend override fun cleanupDocumentOnError(document: Document, err: Throwable)

Clean up after failed initial provisioning (e.g. by deleting the document)

Link copied to clipboard
open suspend override fun createDocument(credentialMetadata: CredentialMetadata, issuerMetadata: ProvisioningMetadata, documentAuthorizationData: ByteString?): Document

Creates a new Document to do initial credential provisioning.

Link copied to clipboard
open suspend override fun createKeyBoundCredentials(document: Document, credentialMetadata: CredentialMetadata, createKeySettings: CreateKeySettings): List<SecureAreaBoundCredential>

Creates a set of pending key-bound credentials.

Link copied to clipboard
open suspend override fun createKeylessCredential(document: Document, credentialMetadata: CredentialMetadata): Credential

Creates a pending keyless credential.

Link copied to clipboard
open suspend override fun updateDocument(document: Document, display: Display?, documentAuthorizationData: ByteString?)

Update the Document data.