WalletService

class WalletService(clientId: String = "https://wallet.a-sit.at/app", redirectUrl: String = "/callback", cryptoService: CryptoService = DefaultCryptoService(EphemeralKeyWithoutCert()), jwsService: JwsService = DefaultJwsService(cryptoService), remoteResourceRetriever: RemoteResourceRetrieverFunction = { null }, stateToCodeStore: MapStore<String, String> = DefaultMapStore())(source)

Client service to retrieve credentials using OID4VCI

Implemented from OpenID for Verifiable Credential Issuance , Draft 14, 2024-08-21.

Constructors

Link copied to clipboard
constructor(clientId: String = "https://wallet.a-sit.at/app", redirectUrl: String = "/callback", keyMaterial: KeyMaterial, remoteResourceRetriever: RemoteResourceRetrieverFunction = { null }, stateToCodeStore: MapStore<String, String> = DefaultMapStore())
constructor(clientId: String = "https://wallet.a-sit.at/app", redirectUrl: String = "/callback", cryptoService: CryptoService = DefaultCryptoService(EphemeralKeyWithoutCert()), jwsService: JwsService = DefaultJwsService(cryptoService), remoteResourceRetriever: RemoteResourceRetrieverFunction = { null }, stateToCodeStore: MapStore<String, String> = DefaultMapStore())

Types

Link copied to clipboard
Link copied to clipboard
data class RequestOptions(val credentialScheme: ConstantIndex.CredentialScheme, val representation: ConstantIndex.CredentialRepresentation = PLAIN_JWT, val requestedAttributes: Set<String>? = null, val state: String = uuid4().toString(), val clock: Clock = Clock.System)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun buildAuthorizationDetails(credentialConfigurationId: String, authorizationServers: Set<String>? = null): Set<AuthorizationDetails.OpenIdCredential>
fun buildAuthorizationDetails(credentialConfigurationIds: Set<String>, authorizationServers: Set<String>? = null): Set<AuthorizationDetails.OpenIdCredential>

Build authorization details for use in OAuth2Client.createAuthRequest.

Link copied to clipboard
Link copied to clipboard
suspend fun createCredentialRequest(input: WalletService.CredentialRequestInput, clientNonce: String?, credentialIssuer: String?): KmmResult<CredentialRequestParameters>

Send the result as JSON-serialized content to the server at /credential (or more specific IssuerMetadata.credentialEndpointUrl).

Link copied to clipboard
suspend fun parseCredentialOffer(input: String): KmmResult<CredentialOffer>

Pass in the URL provided by the Credential Issuer, which may contain a direct CredentialOffer or a URI pointing to it.