Class
JWTSigner
A JWT signer.
final class JWTSigner
Topics
Initializers
init(algorithm: any JWTAlgorithm)init(algorithm: any JWTAlgorithm, jsonEncoder: (any JWTJSONEncoder)?, jsonDecoder: (any JWTJSONDecoder)?)
Instance Properties
Instance Methods
func sign<Payload>(Payload, typ: String, kid: JWKIdentifier?, cty: String?) throws -> Stringfunc unverified(_:as:)func verify(_:as:)
Type Properties
Type Methods
static func eddsa(EdDSAKey) -> JWTSignerstatic func eddsa(EdDSAKey, jsonEncoder: (any JWTJSONEncoder)?, jsonDecoder: (any JWTJSONDecoder)?) -> JWTSignerstatic func es256(key: ECDSAKey) -> JWTSignerstatic func es256(key: ECDSAKey, jsonEncoder: (any JWTJSONEncoder)?, jsonDecoder: (any JWTJSONDecoder)?) -> JWTSignerstatic func es384(key: ECDSAKey) -> JWTSignerstatic func es384(key: ECDSAKey, jsonEncoder: (any JWTJSONEncoder)?, jsonDecoder: (any JWTJSONDecoder)?) -> JWTSignerstatic func es512(key: ECDSAKey) -> JWTSignerstatic func es512(key: ECDSAKey, jsonEncoder: (any JWTJSONEncoder)?, jsonDecoder: (any JWTJSONDecoder)?) -> JWTSignerstatic hs256(key:)static hs256(key:jsonEncoder:jsonDecoder:)static hs384(key:)static hs384(key:jsonEncoder:jsonDecoder:)static hs512(key:)static hs512(key:jsonEncoder:jsonDecoder:)static func rs256(key: RSAKey) -> JWTSignerstatic func rs256(key: RSAKey, jsonEncoder: (any JWTJSONEncoder)?, jsonDecoder: (any JWTJSONDecoder)?) -> JWTSignerstatic func rs384(key: RSAKey) -> JWTSignerstatic func rs384(key: RSAKey, jsonEncoder: (any JWTJSONEncoder)?, jsonDecoder: (any JWTJSONDecoder)?) -> JWTSignerstatic func rs512(key: RSAKey) -> JWTSignerstatic func rs512(key: RSAKey, jsonEncoder: (any JWTJSONEncoder)?, jsonDecoder: (any JWTJSONDecoder)?) -> JWTSignerstatic func unsecuredNone(jsonEncoder: (any JWTJSONEncoder)?, jsonDecoder: (any JWTJSONDecoder)?) -> JWTSigner