\OAuth2\EncryptionJwt

Summary

Methods
Properties
Constants
encode()
decode()
urlSafeB64Encode()
urlSafeB64Decode()
No public properties found
No constants found
generateJwtHeader()
hash_equals()
No protected properties found
N/A
verifySignature()
sign()
generateRSASignature()
No private properties found
N/A

Methods

encode()

encode(  $payload,   $key, string  $algo = 'HS256') : string

Parameters

$payload
$key
string $algo

Returns

string

decode()

decode(string  $jwt, null  $key = null, array|boolean  $allowedAlgorithms = true) : boolean|mixed

Parameters

string $jwt
null $key
array|boolean $allowedAlgorithms

Returns

boolean|mixed

urlSafeB64Encode()

urlSafeB64Encode(string  $data) : string

Parameters

string $data

Returns

string

urlSafeB64Decode()

urlSafeB64Decode(string  $b64) : mixed|string

Parameters

string $b64

Returns

mixed|string

generateJwtHeader()

generateJwtHeader(  $payload,   $algorithm) 

Override to create a custom header

Parameters

$payload
$algorithm

hash_equals()

hash_equals(string  $a, string  $b) : boolean

Parameters

string $a
string $b

Returns

boolean

verifySignature()

verifySignature(  $signature,   $input,   $key, string  $algo = 'HS256') : boolean

Parameters

$signature
$input
$key
string $algo

Throws

\InvalidArgumentException

Returns

boolean

sign()

sign(  $input,   $key, string  $algo = 'HS256') : string

Parameters

$input
$key
string $algo

Throws

\Exception

Returns

string

generateRSASignature()

generateRSASignature(  $input,   $key, string  $algo) : mixed

Parameters

$input
$key
string $algo

Throws

\Exception

Returns

mixed