JWTError

public struct JWTError : Error, Equatable

A struct representing the different errors that can be thrown by SwiftJWT

  • A human readable description of the error.

    Declaration

    Swift

    public let localizedDescription: String
  • Error when an invalid JWT String is provided

    Declaration

    Swift

    public static let invalidJWTString: JWTError
  • Error when the JWT signiture fails verification.

    Declaration

    Swift

    public static let failedVerification: JWTError
  • Error when using RSA encryption with an OS version that is too low.

    Declaration

    Swift

    public static let osVersionToLow: JWTError
  • Error when an invalid private key is provided for RSA encryption.

    Declaration

    Swift

    public static let invalidPrivateKey: JWTError
  • Error when the provided Data cannot be decoded to a String

    Declaration

    Swift

    public static let invalidUTF8Data: JWTError
  • Error when the KeyID field kid in the JWT header fails to generate a JWTSigner or JWTVerifier

    Declaration

    Swift

    public static let invalidKeyID: JWTError
  • Error when a PEM string is provided without the expected PEM headers/footers. (e.g. —–BEGIN PRIVATE KEY—–)

    Declaration

    Swift

    public static let missingPEMHeaders: JWTError
  • Function to check if JWTErrors are equal. Required for equatable protocol.

    Declaration

    Swift

    public static func == (lhs: JWTError, rhs: JWTError) -> Bool
  • Function to enable pattern matching against generic Errors.

    Declaration

    Swift

    public static func ~= (lhs: JWTError, rhs: Error) -> Bool