Accessors
algorithm
- get algorithm(): "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512"
- set algorithm(algorithm: JWTAlgorithm): void
-
Returns "HS256"
|
"HS384"
|
"HS512"
|
"RS256"
|
"RS384"
|
"RS512"
-
Parameters
Returns void
autoValidate
- get autoValidate(): boolean
- set autoValidate(autoValidate: boolean): void
-
Returns boolean
-
Parameters
Returns void
expiresIn
- get expiresIn(): number
- set expiresIn(expiresIn: number): void
-
Returns number
-
Parameters
Returns void
key
- get key(): string
- set key(key: string): void
-
Returns string
-
Parameters
Returns void
privateKey
- get privateKey(): string
- set privateKey(privateKey: string): void
-
Returns string
-
Parameters
Returns void
publicKey
- get publicKey(): string
- set publicKey(publicKey: string): void
-
Returns string
-
Parameters
Returns void
timeOffset
- get timeOffset(): number
- set timeOffset(timeOffset: number): void
-
Returns number
-
Parameters
Returns void
Methods
decode
-
Parameters
-
encoded: string
-
Default value key: string = null
-
Default value algorithm: JWTAlgorithm = this.algorithm
encode
-
Parameters
-
-
Default value key: string = null
-
Default value algorithm: JWTAlgorithm = this.algorithm
Returns string
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
-
Parameters
-
-
Default value key: string = null
-
Default value algorithm: JWTAlgorithm = this.algorithm
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