Package-level declarations

Types

Link copied to clipboard
object Challenge

Helper object to generate and validate short single-use unique values with expiration that are suitable for use as JWT nonce/challenge.

Link copied to clipboard

Defines a specific type of JWT validation.

Functions

Link copied to clipboard
suspend fun buildJwt(type: String, key: AsymmetricKey, header: suspend JsonObjectBuilder.() -> Unit = {}, creationTime: Instant = Clock.System.now(), expiresIn: Duration? = null, body: suspend JsonObjectBuilder.() -> Unit): String

Creates a JWT message signed with the given key.

Link copied to clipboard
suspend fun validateJwt(jwt: String, jwtName: String, publicKey: EcPublicKey?, algorithm: Algorithm? = publicKey?.curve?.defaultSigningAlgorithmFullySpecified, checks: Map<JwtCheck, String> = mapOf(), maxValidity: Duration = 10.hours, clock: Clock = Clock.System): JsonObject

General-purpose JWT jwt validation using a set of built-in required checks (expiration and signature validity) and a set of optional checks specified in checks parameter, mostly aim to simplify server-side code.