Class
JWTSigners
A collection of signers labeled by
kid.final class JWTSigners
Topics
Initializers
init()Create a newJWTSigners.init(defaultJSONEncoder: any JWTJSONEncoder, defaultJSONDecoder: any JWTJSONDecoder)Create a newJWTSignerswith specific JSON coders.
Instance Properties
let defaultJSONDecoder: any JWTJSONDecoderThe default JSON decoder. Used for:let defaultJSONEncoder: any JWTJSONEncoderThe default JSON encoder. Used as:
Instance Methods
func get(kid: JWKIdentifier?, alg: String?) -> JWTSigner?Gets a signer for the suppliedkid, if one exists.func require(kid: JWKIdentifier?, alg: String?) throws -> JWTSignerfunc sign<Payload>(Payload, typ: String, kid: JWKIdentifier?) throws -> Stringfunc unverified(_:as:)func use(JWTSigner, kid: JWKIdentifier?, isDefault: Bool?)Adds a new signer.func use(jwk: JWK, isDefault: Bool?) throwsAdds aJWK(JSON Web Key) to this signers collection.func use(jwks: JWKS) throwsAdds aJWKS(JSON Web Key Set) to this signers collection.func use(jwksJSON: String) throwsAdds aJWKS(JSON Web Key Set) to this signers collection by first decoding the JSON string.func verify(_:as:)