JSON Web Token implementation, based on this spec: https://tools.ietf.org/html/rfc7519
PHP version 5
Methods | ||
---|---|---|
public
static
|
decode(string $jwt, Key|array<string, Key> $keyOrKeyArray): object
|
# |
public
static
|
encode(object|array $payload, string|resource $key, string $alg, mixed $keyId = null, array $head = null): string
|
# |
public
static
|
sign(string $msg, string|resource $key, string $alg): string
|
# |
public
static
|
jsonDecode(string $input): object
|
# |
public
static
|
jsonEncode(object|array $input): string
|
# |
public
static
|
urlsafeB64Decode(string $input): string
|
# |
public
static
|
urlsafeB64Encode(string $input): string
|
# |
public
static
|
constantTimeEquals(string $left, string $right): bool
|
# |
Properties | |||
---|---|---|---|
public
static
|
|
$leeway = 0
|
# |
public
static
|
|
$timestamp = null
|
# |
public
static
|
|
$supported_algs = [
'ES384' => ['openssl', 'SHA384'],
'ES256' => ['openssl', 'SHA256'],
'HS256' => ['hash_hmac', 'SHA256'],
'HS384' => ['hash_hmac', 'SHA384'],
'HS512' => ['hash_hmac', 'SHA512'],
'RS256' => ['openssl', 'SHA256'],
'RS384' => ['openssl', 'SHA384'],
'RS512' => ['openssl', 'SHA512'],
'EdDSA' => ['sodium_crypto', 'EdDSA'],
]
|
# |