Skip to content

Instance Method

add(jwk:isDefault:)

Adds a single JWK (JSON Web Key) to the collection.
@discardableResult func add(jwk: JWK, isDefault: Bool? = nil) throws -> Self

Parameters

jwk

A JWK instance to be added.

isDefault

An optional Boolean indicating whether this key should be the default key.

Return Value

Self for chaining.

Discussion

Throws

JWTError/invalidJWK if the JWK cannot be added due to missing key identifier.