WalletService
class WalletService( val clientId: String = "https://wallet.a-sit.at/app", redirectUrl: String = "/callback", cryptoService: CryptoService = DefaultCryptoService(EphemeralKeyWithoutCert()), jwsService: JwsService = DefaultJwsService(cryptoService), remoteResourceRetriever: RemoteResourceRetrieverFunction = { null }, loadKeyAttestation: suspend (WalletService.KeyAttestationInput) -> KmmResult<JwsSigned<KeyAttestationJwt>>? = null, requestEncryption: Boolean = false, decryptionKeyMaterial: KeyMaterial? = null)(source)
Client service to retrieve credentials using OID4VCI
Implemented from OpenID for Verifiable Credential Issuance , Draft 15, 2024-12-19.
Constructors
Link copied to clipboard
constructor( clientId: String = "https://wallet.a-sit.at/app", redirectUrl: String = "/callback", cryptoService: CryptoService = DefaultCryptoService(EphemeralKeyWithoutCert()), jwsService: JwsService = DefaultJwsService(cryptoService), remoteResourceRetriever: RemoteResourceRetrieverFunction = { null }, loadKeyAttestation: suspend (WalletService.KeyAttestationInput) -> KmmResult<JwsSigned<KeyAttestationJwt>>? = null, requestEncryption: Boolean = false, decryptionKeyMaterial: KeyMaterial? = null)
constructor( clientId: String = "https://wallet.a-sit.at/app", redirectUrl: String = "/callback", keyMaterial: KeyMaterial, remoteResourceRetriever: RemoteResourceRetrieverFunction = { null })
Types
Link copied to clipboard
Link copied to clipboard
data class KeyAttestationInput(val clientNonce: String?, val supportedAlgorithms: Collection<String>?)
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
Used to create request parameters, e.g. AuthenticationRequestParameters, typically a URI.
Link copied to clipboard
Functions
Link copied to clipboard
fun buildAuthorizationDetails(credentialConfigurationId: String, authorizationServers: Set<String>? = null): Set<OpenIdAuthorizationDetails>
fun buildAuthorizationDetails(credentialConfigurationIds: Set<String>, authorizationServers: Set<String>? = null): Set<OpenIdAuthorizationDetails>
Build authorization details for use in OAuth2Client.createAuthRequest.
Link copied to clipboard
Build scope
value for use in OAuth2Client.createAuthRequest and OAuth2Client.createTokenRequestParameters.
Link copied to clipboard
suspend fun createCredentialRequest( input: WalletService.CredentialRequestInput, clientNonce: String?, credentialIssuer: String?, clock: Clock = Clock.System): KmmResult<CredentialRequestParameters>
suspend fun createCredentialRequest( tokenResponse: TokenResponseParameters, metadata: IssuerMetadata, credentialFormat: SupportedCredentialFormat, clientNonce: String? = null, previouslyRequestedScope: String? = null, clock: Clock = Clock.System): KmmResult<Collection<CredentialRequestParameters>>
Send the result as JSON-serialized content to the server at /credential
(or more specific IssuerMetadata.credentialEndpointUrl).
Link copied to clipboard
Pass in the URL provided by the Credential Issuer, which may contain a direct CredentialOffer or a URI pointing to it.
Link copied to clipboard
fun selectSupportedCredentialFormat(requestOptions: WalletService.RequestOptions, metadata: IssuerMetadata): SupportedCredentialFormat?
Extract SupportedCredentialFormat from metadata by filtering according to requestOptions.