ReceivedCredential

sealed interface ReceivedCredential(source)

A credential of a credential response, see OpenId4VciClient.decodeCredentialResponse. It has not been validated: pass it to prepareCredentialStorage, which validates it with the holder's key and validator.

Inheritors

Types

Link copied to clipboard

A credential decoded from its encoding in the credential response (OpenID4VCI 1.0, Appendix A).

Link copied to clipboard
data class Undecodable(val cause: Throwable) : ReceivedCredential

A credential that could not be decoded from its encoding in the credential response, e.g. an mdoc that is no base64url (OpenID4VCI 1.0, A.2.4). It is reported as rejected, see HolderAgent.rejectUndecodable.

Functions

Link copied to clipboard
open suspend fun prepareCredentialStorage(holder: HolderAgent, scheme: CredentialScheme, policy: ValidationPolicy, renewalInfo: CredentialRenewalInfo? = null): KmmResult<PreparedCredentialStorage>

Validates this credential of the type of scheme for storage by holder under policy, with renewalInfo, see HolderAgent.prepareCredentialStorage, and stores nothing yet. A credential that could not be decoded is prepared as rejected, so that it is reported like every other credential of a batch, but can never be stored.