Package-level declarations

Types

Link copied to clipboard
sealed interface CredentialIssuanceResult

Result of the credential issuance process: Either open an authentication request URL externally (i.e. the browser), or store the received credentials.

Link copied to clipboard

A non-success HTTP response with its OAuth or RFC 9457 error details, when available, as thrown by the ktor-based clients in this module.

Link copied to clipboard
data class IssuedCredentials(val credentialIdentifierInfo: CredentialIdentifierInfo, val receivedCredentials: List<ReceivedCredential>, val scheme: CredentialScheme, val refreshToken: CredentialRenewalInfo?)

The credentials issued for one requested credential configuration, see CredentialIssuanceResult.Success.issued.

Link copied to clipboard
class KtorSdJwtTypeMetadataDocumentRetriever(val httpClient: HttpClient, val clock: Clock, val locateUrl: (SdJwtVcType) -> String?, val json: Json = Json.Default, val integrityChecker: SdJwtTypeMetadataDocumentIntegrityChecker = SdJwtTypeMetadataDocumentIntegrityChecker.DEFAULT) : SdJwtTypeMetadataDocumentRetriever
Link copied to clipboard

Implements the client side of OAuth2 with ktor, by sending the requests of OAuth2ProtocolClient, which implements the protocol.

Link copied to clipboard
Link copied to clipboard

Implements the client side of OpenID for Verifiable Credential Issuance 1.0 from 2025-09-16 with ktor, by sending the requests of OpenId4VciProtocolClient and at.asitplus.wallet.lib.oauth2.OAuth2ProtocolClient, which implement the protocols, in the order of each flow. Supported features:

Link copied to clipboard
class OpenId4VpKtorHolder(httpClient: HttpClient, keyMaterial: KeyMaterial, holder: Holder, encryptJarm: EncryptJweFun = EncryptJwe(), supportedAlgorithms: Set<SignatureAlgorithm> = setOf(SignatureAlgorithm.ECDSAwithSHA256), clientId: String = "https://wallet.a-sit.at/", authorizationEndpoint: String = "openid4vp:", walletNonceMapStore: MapStore<String, String> = DefaultMapStore(), randomSource: RandomSource = RandomSource.Secure, lookupJsonWebKeysForClient: (OpenId4VpHolder.JsonWebKeyLookupInput) -> JsonWebKeySet? = { null }, allowedDcApiOriginSchemes: suspend () -> Set<String> = { OpenId4VpHolder.DEFAULT_ALLOWED_DC_API_ORIGIN_SCHEMES }, ephemeralEncryptionKeyService: EphemeralEncryptionKeyService? = null, supportedJweEncryptionAlgorithms: Set<JweEncryption> = JweEncryption.entries.toSet(), requireEncryptedRequests: Boolean = false, relyingPartyValidator: RelyingPartyValidator = RelyingPartyValidator())

Implements the wallet side of Self-Issued OpenID Provider v2 and OpenID for Verifiable Presentations with ktor, by sending the requests of OpenId4VpProtocolClient, which implements the protocol.

Link copied to clipboard
Link copied to clipboard
@Serializable
data class ProvisioningContext(val state: String, val credential: CredentialIdentifierInfo, val credentials: List<CredentialIdentifierInfo> = listOf(credential), val oauthMetadata: OAuth2AuthorizationServerMetadata, val issuerMetadata: IssuerMetadata, val reissuingStoreEntryId: Long? = null)

Gets stored before jumping into the web browser (with the authorization request), so that we can load it back when we resume the issuing process with the auth code

Link copied to clipboard
class RemoteCredentialMetadataRegistry @JvmOverloads constructor(httpClient: HttpClient, clock: Clock, val documentUrls: MutableMap<SdJwtVcType, String> = mutableMapOf(), aliases: Map<CredentialMetadataLookup, SdJwtVcType> = emptyMap(), integrityMetadata: Map<SdJwtVcType, W3cSubresourceIntegrityMetadata> = emptyMap(), json: Json = Json.Default, integrityChecker: SdJwtTypeMetadataDocumentIntegrityChecker = SdJwtTypeMetadataDocumentIntegrityChecker.DEFAULT) : CredentialMetadataRegistry

A CredentialMetadataRegistry that fetches metadata documents over HTTP, mirroring at.asitplus.wallet.lib.data.StaticCredentialMetadataRegistry but with remote retrieval.

Link copied to clipboard

Uses an external OAuth 2.0 Authorization Server with a at.asitplus.wallet.lib.oidvci.OpenId4VciServer, i.e., delegate authorization to the external AS, and load user info from there (after performing token exchange with the Wallet's access token to get a fresh one). Authenticates with the clientAttestation the remote authorization server expects, if any.

Functions

Link copied to clipboard
fun OAuth2Error?.attestationChallenge(response: HttpResponse): String?

Extracts the header OAuth-Client-Attestation-Challenge if the error is use_attestation_challenge.

Link copied to clipboard
fun OAuth2Error?.dpopNonce(response: HttpResponse): String?

Extracts the header DPoP-Nonce if the server asked for it with use_dpop_nonce.

Link copied to clipboard
fun <T> CoroutineScope.lazyDeferred(block: suspend CoroutineScope.() -> T): Lazy<Deferred<T>>
Link copied to clipboard
fun HttpRequestData.toRequestInfo(): RequestInfo