Options
All
  • Public
  • Public/Protected
  • All
Menu

Class JWT

Hierarchy

  • JWT

Index

Constructors

constructor

Accessors

algorithm

  • get algorithm(): "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512"
  • set algorithm(algorithm: JWTAlgorithm): void

autoValidate

  • get autoValidate(): boolean
  • set autoValidate(autoValidate: boolean): void

expiresIn

  • get expiresIn(): number
  • set expiresIn(expiresIn: number): void

key

  • get key(): string
  • set key(key: string): void

privateKey

  • get privateKey(): string
  • set privateKey(privateKey: string): void

publicKey

  • get publicKey(): string
  • set publicKey(publicKey: string): void

timeOffset

  • get timeOffset(): number
  • set timeOffset(timeOffset: number): void

Methods

decode

  • Parameters

    • encoded: string
    • Default value key: string = null
    • Default value algorithm: JWTAlgorithm = this.algorithm

    Returns JWTData

encode

signRaw

  • signRaw(data: string, key?: string, algorithm?: JWTAlgorithm): string
  • Parameters

    • data: string
    • Default value key: string = null
    • Default value algorithm: JWTAlgorithm = this.algorithm

    Returns string

validate

verifyRaw

  • verifyRaw(data: string, signature: string, key?: string, algorithm?: JWTAlgorithm): boolean
  • Parameters

    • data: string
    • signature: string
    • Default value key: string = null
    • Default value algorithm: JWTAlgorithm = this.algorithm

    Returns boolean

Static parsePayload