WalletService

class WalletService(clientId: String = "https://wallet.a-sit.at/app", redirectUrl: String = "/callback", cryptoService: CryptoService = DefaultCryptoService(), jwsService: JwsService = DefaultJwsService(cryptoService), coseService: CoseService = DefaultCoseService(cryptoService))

Client service to retrieve credentials using OpenID for Verifiable Credential Issuance. Implemented from Draft openid-4-verifiable-credential-issuance-1_0-11, 2023-02-03.

Constructors

Link copied to clipboard
constructor(clientId: String = "https://wallet.a-sit.at/app", redirectUrl: String = "/callback", cryptoService: CryptoService = DefaultCryptoService(), jwsService: JwsService = DefaultJwsService(cryptoService), coseService: CoseService = DefaultCoseService(cryptoService))

Types

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

Functions

Link copied to clipboard
suspend fun createAuthRequest(requestOptions: WalletService.RequestOptions, credentialIssuer: String? = null): AuthenticationRequestParameters

Send the result as parameters (either POST or GET) to the server at /authorize (or more specific IssuerMetadata.authorizationEndpointUrl)

suspend fun createAuthRequest(scope: String, credentialIssuer: String? = null, state: String = uuid4().toString()): AuthenticationRequestParameters

Send the result as parameters (either POST or GET) to the server at /authorize (or more specific IssuerMetadata.authorizationEndpointUrl).

Link copied to clipboard
suspend fun createCredentialRequestCwt(requestOptions: WalletService.RequestOptions, clientNonce: String?, credentialIssuer: String?): KmmResult<CredentialRequestParameters>

Send the result as JSON-serialized content to the server at /credential (or more specific IssuerMetadata.credentialEndpointUrl). Also send along the TokenResponseParameters.accessToken from the token response in HTTP header Authorization as value Bearer <accessTokenValue> (depending on the TokenResponseParameters.tokenType).

Link copied to clipboard
suspend fun createCredentialRequestJwt(requestOptions: WalletService.RequestOptions, clientNonce: String?, credentialIssuer: String?): KmmResult<CredentialRequestParameters>

Send the result as JSON-serialized content to the server at /credential (or more specific IssuerMetadata.credentialEndpointUrl). Also send along the TokenResponseParameters.accessToken from the token response in HTTP header Authorization as value Bearer accessTokenValue (depending on the TokenResponseParameters.tokenType).

Link copied to clipboard

Send the result as POST parameters (form-encoded) to the server at /token (or more specific IssuerMetadata.tokenEndpointUrl)