|
ILIAS
release_8 Revision v8.24
|
Collaboration diagram for Firebase\JWT\JWT:Static Public Member Functions | |
| static | decode (string $jwt, $keyOrKeyArray, stdClass &$headers=null) |
| Decodes a JWT string into a PHP object. More... | |
| static | encode (array $payload, $key, string $alg, string $keyId=null, array $head=null) |
| Converts and signs a PHP array into a JWT string. More... | |
| static | sign (string $msg, $key, string $alg) |
| Sign a string with a given key and algorithm. More... | |
| static | jsonDecode (string $input) |
| Decode a JSON string into a PHP object. More... | |
| static | jsonEncode (array $input) |
| Encode a PHP array into a JSON string. More... | |
| static | urlsafeB64Decode (string $input) |
| Decode a string with URL-safe Base64. More... | |
| static | convertBase64UrlToBase64 (string $input) |
| Convert a string in the base64url (URL-safe Base64) encoding to standard base64. More... | |
| static | urlsafeB64Encode (string $input) |
| Encode a string with URL-safe Base64. More... | |
| static | constantTimeEquals (string $left, string $right) |
Static Public Attributes | |
| static int | $leeway = 0 |
| static int | $timestamp = null |
| static array | $supported_algs |
Static Private Member Functions | |
| static | verify (string $msg, string $signature, $keyMaterial, string $alg) |
| Verify a signature with the message, key and method. More... | |
| static | getKey ( $keyOrKeyArray, ?string $kid) |
| Determine if an algorithm has been provided for each Key. More... | |
| static | handleJsonError (int $errno) |
| Helper method to create a JSON error. More... | |
| static | safeStrlen (string $str) |
| Get the number of bytes in cryptographic strings. More... | |
| static | signatureToDER (string $sig) |
| Convert an ECDSA signature to an ASN.1 DER sequence. More... | |
| static | encodeDER (int $type, string $value) |
| Encodes a value into a DER object. More... | |
| static | signatureFromDER (string $der, int $keySize) |
| Encodes signature from a DER object. More... | |
| static | readDER (string $der, int $offset=0) |
| Reads binary DER-encoded data and decodes into a single object. More... | |
Private Attributes | |
| const | ASN1_INTEGER = 0x02 |
| const | ASN1_SEQUENCE = 0x10 |
| const | ASN1_BIT_STRING = 0x03 |
|
static |
| string | $left | The string of known length to compare against |
| string | $right | The user-supplied string |
Definition at line 489 of file JWT.php.
References $i.
|
static |
Convert a string in the base64url (URL-safe Base64) encoding to standard base64.
| string | $input | A Base64 encoded string with URL-safe characters (-_ and no padding) |
Definition at line 427 of file JWT.php.
|
static |
Decodes a JWT string into a PHP object.
| string | $jwt | The JWT |
| Key|ArrayAccess<string,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'. | |
| stdClass | $headers | Optional. Populates stdClass with headers. |
| 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
Definition at line 96 of file JWT.php.
Referenced by ilObjLTIConsumerGUI\saveContentSelection(), and ILIAS\LTI\ToolProvider\Jwt\FirebaseClient\verify().
Here is the caller graph for this function:
|
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
Definition at line 199 of file JWT.php.
Referenced by ilObjLTIConsumer\LTISignJWT().
Here is the caller graph for this function:
|
staticprivate |
Encodes a value into a DER object.
| int | $type | DER tag |
| string | $value | the value to encode |
Definition at line 585 of file JWT.php.
References $type.
|
staticprivate |
Determine if an algorithm has been provided for each Key.
| Key|ArrayAccess<string,Key>|array<string,Key> | $keyOrKeyArray | |
| string | null | $kid |
| UnexpectedValueException |
Definition at line 460 of file JWT.php.
|
staticprivate |
Helper method to create a JSON error.
| int | $errno | An error number from json_last_error() |
| DomainException |
Definition at line 514 of file JWT.php.
References $messages.
|
static |
Decode a JSON string into a PHP object.
| string | $input | JSON string |
| DomainException | Provided string was invalid JSON |
Definition at line 363 of file JWT.php.
|
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 |
Definition at line 384 of file JWT.php.
|
staticprivate |
Reads binary DER-encoded data and decodes into a single object.
| string | $der | the binary data in DER format |
| int | $offset | the offset of the data stream containing the object to decode |
Definition at line 637 of file JWT.php.
|
staticprivate |
|
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 'EdDSA', 'ES384', 'ES256', 'ES256K', 'HS256', 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' |
| DomainException | Unsupported algorithm or bad key was specified |
Definition at line 236 of file JWT.php.
|
staticprivate |
Encodes signature from a DER object.
| string | $der | binary signature in DER format |
| int | $keySize | the number of bits in the key |
Definition at line 609 of file JWT.php.
|
staticprivate |
Convert an ECDSA signature to an ASN.1 DER sequence.
| string | $sig | The ECDSA signature to convert |
Definition at line 551 of file JWT.php.
|
static |
Decode a string with URL-safe Base64.
| string | $input | A Base64 encoded string |
| InvalidArgumentException | invalid base64 characters |
Definition at line 412 of file JWT.php.
Referenced by Firebase\JWT\JWK\createPemFromCrvAndXYCoordinates(), and ILIAS\LTI\ToolProvider\Jwt\FirebaseClient\load().
Here is the caller graph for this function:
|
static |
Encode a string with URL-safe Base64.
| string | $input | The string you want encoded |
Definition at line 444 of file JWT.php.
Referenced by ILIAS\LTI\ToolProvider\Jwt\FirebaseClient\getJWKS().
Here is the caller graph for this function:
|
staticprivate |
Verify a signature with the message, key and method.
Not all methods are symmetric, so we must have a separate verify and sign method.
| string | $msg | The original message (header and body) |
| string | $signature | The original signature |
| string | resource | OpenSSLAsymmetricKey | OpenSSLCertificate | $keyMaterial | For Ed*, ES*, HS*, a string key works. for RS*, must be an instance of OpenSSLAsymmetricKey |
| string | $alg | The algorithm |
| DomainException | Invalid Algorithm, bad key, or OpenSSL failure |
Definition at line 299 of file JWT.php.
|
static |
Definition at line 41 of file JWT.php.
Referenced by ILIAS\LTI\ToolProvider\Jwt\FirebaseClient\verify().
|
static |