San Romilla 1.0.0
|
Static Public Member Functions | |
static | decode (string $jwt, $keyOrKeyArray) |
static | encode (array $payload, $key, string $alg, string $keyId=null, array $head=null) |
static | sign (string $msg, $key, string $alg) |
static | jsonDecode (string $input) |
static | jsonEncode (array $input) |
static | urlsafeB64Decode (string $input) |
static | urlsafeB64Encode (string $input) |
static | constantTimeEquals (string $left, string $right) |
Static Public Attributes | |
static | $leeway = 0 |
static | $timestamp = null |
static | $supported_algs |
|
static |
string | $left | The string of known length to compare against |
string | $right | The user-supplied string |
|
static |
Decodes a JWT string into a PHP object.
string | $jwt | The JWT |
Key|array<string,Key> | $keyOrKeyArray The Key or associative array of key IDs (kid) to Key objects. If the algorithm used is asymmetric, this is the public key Each Key object contains an algorithm and matching key. Supported algorithms are 'ES384','ES256', 'HS256', 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' |
InvalidArgumentException | Provided key/key-array was empty or malformed |
DomainException | Provided JWT is malformed |
UnexpectedValueException | Provided JWT was invalid |
SignatureInvalidException | Provided JWT was invalid because the signature verification failed |
BeforeValidException | Provided JWT is trying to be used before it's eligible as defined by 'nbf' |
BeforeValidException | Provided JWT is trying to be used before it's been created as defined by 'iat' |
ExpiredException | Provided JWT has since expired, as defined by the 'exp' claim |
@uses jsonDecode @uses urlsafeB64Decode
|
static |
Converts and signs a PHP array into a JWT string.
array<mixed> | $payload PHP array | |
string | resource | OpenSSLAsymmetricKey | OpenSSLCertificate | $key | The secret key. |
string | $alg | Supported algorithms are 'ES384','ES256', 'ES256K', 'HS256', 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' |
string | $keyId | |
array<string,string> | $head An array with header elements to attach |
@uses jsonEncode @uses urlsafeB64Encode
|
static |
Decode a JSON string into a PHP object.
string | $input | JSON string |
DomainException | Provided string was invalid JSON |
|
static |
Encode a PHP array into a JSON string.
array<mixed> | $input A PHP array |
DomainException | Provided object could not be encoded to valid JSON |
|
static |
Sign a string with a given key and algorithm.
string | $msg | The message to sign |
string | resource | OpenSSLAsymmetricKey | OpenSSLCertificate | $key | The secret key. |
string | $alg | Supported algorithms are 'ES384','ES256', 'ES256K', 'HS256', 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' |
DomainException | Unsupported algorithm or bad key was specified |
|
static |
Decode a string with URL-safe Base64.
string | $input | A Base64 encoded string |
InvalidArgumentException | invalid base64 characters |
|
static |
Encode a string with URL-safe Base64.
string | $input | The string you want encoded |
|
static |