buildMultisignedJwt

suspend fun buildMultisignedJwt(type: String, keys: List<AsymmetricKey>, header: suspend JsonObjectBuilder.(index: Int) -> Unit = {}, creationTime: Instant = Clock.System.now(), expiresIn: Duration? = null, builderAction: suspend JsonObjectBuilder.() -> Unit): JsonObject

Creates a JWT message signed with the multiple keys.

JWT headers contains type (typ), signature algorithm (alg) and, unless the keys are AsymmetricKey.Anonymous, key identification (either kid or x5c). The body of the JWT will have issuance time (iat) and optionally expiration time (exp), unless creationTime is set to Instant.DISTANT_PAST

Return

signed JWT (JSON object)

Parameters

type

JWT type

keys

list of the private keys to sign JWT and provide key identifying information in the JWT header

header

JSON object builder block to provide additional header fields

creationTime

JWT issuance timestamp (iat)

expiresIn

validity duration for the JWT (if any)

builderAction

JSON object builder block for JWT body