ProvisioningModel

class ProvisioningModel(documentProvisioningHandler: AbstractDocumentProvisioningHandler, httpClient: HttpClient, promptModel: PromptModel, authorizationSecureArea: SecureArea)

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

documentProvisioningHandler

object that manages document and credential creation, e.g. DocumentProvisioningHandler.

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

authorizationSecureArea

secure area that is used to store session authorization keys during provisioning; when credentials are refreshed, it is important that the SecureArea used during refresh is the same that was used during the initial provisioning

Constructors

Link copied to clipboard
constructor(documentProvisioningHandler: AbstractDocumentProvisioningHandler, httpClient: HttpClient, promptModel: PromptModel, authorizationSecureArea: SecureArea)

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

State of the model

Functions

Link copied to clipboard
fun cancel()

Cancel currently-running provisioning session (if any) and sets the state to Idle.

Link copied to clipboard
fun launch(coroutineContext: CoroutineContext, document: Document? = null, 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
fun launchOpenID4VCIRefreshCredentials(document: Document, authorizationData: ByteString, clientPreferences: OpenID4VCIClientPreferences, backend: OpenID4VCIBackend): Deferred<Document>

Launch provisioning session to provision additional credentials to an existing Document.

Link copied to clipboard