Builder

Builder for constructing a JwtHeader with standard and extra parameters.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The content type (cty) header parameter, used when the payload is itself a JWT.

Link copied to clipboard
var type: String?

The token type (typ) header parameter; defaults to "JWT".

Functions

Link copied to clipboard
inline fun <T> extra(name: String, value: T)

Sets an extra header parameter, inferring the serializer from the reified type T.

fun extra(name: String, value: JsonElement?)

Sets an extra header parameter using a pre-built JsonElement, or removes it if value is null.

fun <T> extra(name: String, serializer: SerializationStrategy<T>, value: T?, jsonInstance: Json = Jwt.defaultJsonParser)

Sets an extra header parameter using an explicit SerializationStrategy.

Link copied to clipboard
inline fun <T> takeFrom(value: T)

Merges all fields from value into this builder, inferring the serializer from the reified type T.

fun <T> takeFrom(serializer: SerializationStrategy<T>, value: T, jsonInstance: Json = Jwt.defaultJsonParser)

Merges all fields from value into this builder, encoded using serializer.