См. определение в файле jwt.php строка 22
◆ decode()
decode |
( |
| $jwt, |
|
|
| $key, |
|
|
array | $allowed_algs = array() ) |
|
static |
Decodes a JWT string into a PHP object.
- Аргументы
-
string | $jwt | The JWT |
string | array | resource | $key | The key, or map of keys. If the algorithm used is asymmetric, this is the public key |
array | $allowed_algs | List of supported verification algorithms Supported algorithms are 'ES256', 'HS256', 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' |
- Возвращает
- object The JWT's payload as a PHP object
- Исключения
-
UnexpectedValueException | Provided JWT was invalid |
@uses jsonDecode @uses urlsafeB64Decode
См. определение в файле jwt.php строка 69
◆ encode()
encode |
( |
| $payload, |
|
|
| $key, |
|
|
| $alg = 'HS256', |
|
|
| $keyId = null, |
|
|
| $head = null ) |
|
static |
Converts and signs a PHP object or array into a JWT string.
- Аргументы
-
object | array | $payload | PHP object or array |
string | $key | The secret key. If the algorithm used is asymmetric, this is the private key |
string | $alg | The signing algorithm. Supported algorithms are 'ES256', 'HS256', 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' |
mixed | $keyId | |
array | $head | An array with header elements to attach |
- Возвращает
- string A signed JWT
@uses jsonEncode @uses urlsafeB64Encode
См. определение в файле jwt.php строка 161
◆ jsonDecode()
Decode a JSON string into a PHP object.
- Аргументы
-
- Возвращает
- object Object representation of JSON string
- Исключения
-
DomainException | Provided string was invalid JSON |
In PHP >=5.4.0, json_decode() accepts an options parameter, that allows you to specify that large ints (like Steam Transaction IDs) should be treated as strings, rather than the PHP default behaviour of converting them to floats.
Not all servers will support that, however, so for older versions we must manually detect large ints in the JSON string and quote them (thus converting them to strings) before decoding, hence the preg_replace() call.
См. определение в файле jwt.php строка 275
◆ jsonEncode()
Encode a PHP object into a JSON string.
- Аргументы
-
object | array | $input | A PHP object or array |
- Возвращает
- string JSON representation of the PHP object or array
- Исключения
-
DomainException | Provided object could not be encoded to valid JSON |
См. определение в файле jwt.php строка 310
◆ sign()
sign |
( |
| $msg, |
|
|
| $key, |
|
|
| $alg = 'HS256' ) |
|
static |
Sign a string with a given key and algorithm.
- Аргументы
-
string | $msg | The message to sign |
string | resource | $key | The secret key |
string | $alg | The signing algorithm. Supported algorithms are 'ES256', 'HS256', 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' |
- Возвращает
- string An encrypted message
- Исключения
-
DomainException | Unsupported algorithm was specified |
См. определение в файле jwt.php строка 193
◆ urlsafeB64Decode()
urlsafeB64Decode |
( |
| $input | ) |
|
|
static |
Decode a string with URL-safe Base64.
- Аргументы
-
string | $input | A Base64 encoded string |
- Возвращает
- string A decoded string
См. определение в файле jwt.php строка 328
◆ urlsafeB64Encode()
urlsafeB64Encode |
( |
| $input | ) |
|
|
static |
Encode a string with URL-safe Base64.
- Аргументы
-
string | $input | The string you want encoded |
- Возвращает
- string The base64 encode of what you passed in
См. определение в файле jwt.php строка 345
◆ $leeway
When checking nbf, iat or expiration times, we want to provide some extra leeway time to account for clock skew.
См. определение в файле jwt.php строка 33
◆ $supported_algs
Инициализатор
'ES256' =>
array(
'openssl',
'SHA256'),
'HS256' =>
array(
'hash_hmac',
'SHA256'),
'HS384' =>
array(
'hash_hmac',
'SHA384'),
'HS512' =>
array(
'hash_hmac',
'SHA512'),
'RS256' =>
array(
'openssl',
'SHA256'),
'RS384' =>
array(
'openssl',
'SHA384'),
'RS512' =>
array(
'openssl',
'SHA512'),
)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
См. определение в файле jwt.php строка 43
◆ $timestamp
Allow the current timestamp to be specified. Useful for fixing a value within unit testing.
Will default to PHP time() value if null.
См. определение в файле jwt.php строка 41
◆ ASN1_BIT_STRING
const ASN1_BIT_STRING = 0x03 |
◆ ASN1_INTEGER
const ASN1_INTEGER = 0x02 |
◆ ASN1_SEQUENCE
const ASN1_SEQUENCE = 0x10 |
Объявления и описания членов класса находятся в файле:
- C:/bitrix/modules/main/lib/web/jwt.php