ProvisioningModel

class ProvisioningModel(documentStore: DocumentStore, secureArea: SecureArea, httpClient: HttpClient, promptModel: PromptModel, documentMetadataInitializer: suspend (metadata: AbstractDocumentMetadata, credentialDisplay: Display, issuerDisplay: Display) -> Unit)

This model supports UX/UI flow for provisioning of credentials.

Only a single provisioning session per model object can be active at any time.

Parameters

documentStore

new Document will be created in this DocumentStore

secureArea

Credential objects will be bound to this SecureArea

httpClient

HTTP client used to communicate to the provisioning server, it MUST NOT handle redirects automatically

promptModel

PromptModel that is used to show prompts to generate proof-of-possession for credential keys

documentMetadataInitializer

function that initializes document metadata at Document creation time based on issuance server metadata

Constructors

Link copied to clipboard
constructor(documentStore: DocumentStore, secureArea: SecureArea, httpClient: HttpClient, promptModel: PromptModel, documentMetadataInitializer: suspend (metadata: AbstractDocumentMetadata, credentialDisplay: Display, issuerDisplay: Display) -> Unit)

Types

Link copied to clipboard

User was successfully authorized

Link copied to clipboard
data class Authorizing(val authorizationChallenges: List<AuthorizationChallenge>) : ProvisioningModel.State

Authorizing the user.

Link copied to clipboard
object Companion
Link copied to clipboard

Connected to the provisioning server

Link copied to clipboard

Credentials are issued, provisioning has stopped

Link copied to clipboard
data class Error(val err: Throwable) : ProvisioningModel.State

Error occurred when provisioning, provisioning has stopped

Link copied to clipboard

Provisioning is not active

Link copied to clipboard

Provisioning is about to start

Link copied to clipboard

Authorization response is being processed

Link copied to clipboard

Credentials are being requested from the provisioning server

Link copied to clipboard
sealed class State

Represents model's state

Properties

Link copied to clipboard

State of the model

Functions

Link copied to clipboard
fun cancel()

Cancel currently-running provisioning session (if any).

Link copied to clipboard
fun launch(coroutineContext: CoroutineContext, provisioningClientFactory: suspend () -> ProvisioningClient): Deferred<Document>

Launch provisioning session to provision credentials to a new Document using given ProvisioningClient factory.

Link copied to clipboard
fun launchOpenID4VCIProvisioning(offerUri: String, clientPreferences: OpenID4VCIClientPreferences, backend: OpenID4VCIBackend): Deferred<Document>

Launch provisioning session to provision credentials to a new Document using OpenID4VCI protocol.

Link copied to clipboard