Package-level declarations

Types

Link copied to clipboard
data class IssuanceState(var clientId: String?, val scope: String, var clientAttestationKey: EcPublicKey?, var dpopKey: EcPublicKey?, var redirectUri: String?, var codeChallenge: ByteString?, val configurationId: String?, var clientState: String? = null, var authorized: Boolean? = null, var openid4VpVerifierModel: Openid4VpVerifierModel? = null, var systemOfRecordAuthCode: String? = null, var systemOfRecordCodeVerifier: ByteString? = null, var systemOfRecordAccess: SystemOfRecordAccess? = null, var txCodeSpec: SecretCodeRequest? = null, var txCodeHash: ByteString? = null, val urlSchema: String? = null)
Link copied to clipboard

Types of opaque session ids for client-server communication.

Link copied to clipboard
class OpenID4VCIRequestError(val code: String, val description: String) : Exception

Represents an error as it commonly formatted in OpenID specs: error code and description.

Link copied to clipboard
data class SystemOfRecordAccess(val accessToken: String, val accessTokenExpiration: Instant, val refreshToken: String?)

Authentication information to access System of Record.

Properties

Link copied to clipboard
val AUTHZ_REQ: ContentType
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun addFreshNonceHeaders(call: ApplicationCall)
Link copied to clipboard
suspend fun authorizeWithDpop(request: ApplicationRequest, publicKey: EcPublicKey, clientId: String, accessToken: String?, initial: Boolean = false)

DPoP Authorization validation.

Link copied to clipboard
suspend fun codeToId(type: OpaqueIdType, code: String): String

Decodes opaque session id ("code") into server-side id, validating code purpose (type) and expiration time.

Link copied to clipboard
suspend fun createSession(request: ApplicationRequest, parameters: Parameters, requireAuthentication: Boolean = true): String

Creates issuance session based on the given HTTP request and returns a unique id for it.

Link copied to clipboard
fun extractAccessToken(request: ApplicationRequest): String

Extract access token for a DPoP-protected requests.

Link copied to clipboard
suspend fun generatePreauthorizedOffer(offerSchema: String, id: String, state: IssuanceState, expiresIn: Duration = 100.days): String
Link copied to clipboard
Link copied to clipboard
suspend fun getScopeAndCredentialId(parameters: Parameters): Pair<String, String?>
Link copied to clipboard
suspend fun idToCode(type: OpaqueIdType, id: String, expiresIn: Duration): String

Creates an opaque session id ("code") that can be safely given to the client. On the server the session is just identified by its id, which stays the same. When referencing the session from the client, we do not want the client to be able to play any games, thus the actual server-side id and a small amount of metadata is encrypted using server secret key.

Link copied to clipboard
fun parseTxKind(txKind: String?, txPrompt: String?): SecretCodeRequest?
Link copied to clipboard
fun processInitialDPoP(request: ApplicationRequest): EcPublicKey?

Process the initial DPoP header (that establishes the key for the rest of the session).

Link copied to clipboard
suspend fun respondWithNewClientAttestationChallenge(call: ApplicationCall)
Link copied to clipboard
suspend fun respondWithNewDPoPNonce(call: ApplicationCall)
Link copied to clipboard
suspend fun validateClientAssertion(parameters: Parameters, clientId: String): Boolean

Validates Oauth client assertion.

Link copied to clipboard
suspend fun validateClientAttestation(request: ApplicationRequest, clientId: String): EcPublicKey?

Ensures Oauth client attestation attached to the given HTTP request is valid.

Link copied to clipboard
suspend fun validateClientAttestationPoP(request: ApplicationRequest, clientId: String, attestationKey: EcPublicKey)

Ensures Oauth client attestation proof-of-possession attached to the given HTTP request is valid.