Открытые статические члены | |
static | decode ($jwt, $key, array $allowed_algs=array()) |
static | encode ($payload, $key, $alg='HS256', $keyId=null, $head=null) |
static | sign ($msg, $key, $alg='HS256') |
static | jsonDecode ($input) |
static | jsonEncode ($input) |
static | urlsafeB64Decode ($input) |
static | urlsafeB64Encode ($input) |
Открытые атрибуты | |
const | ASN1_INTEGER = 0x02 |
const | ASN1_SEQUENCE = 0x10 |
const | ASN1_BIT_STRING = 0x03 |
Статические открытые данные | |
static | $leeway = 0 |
static | $timestamp = null |
static | $supported_algs |
|
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' |
UnexpectedValueException | Provided JWT was invalid |
@uses jsonDecode @uses urlsafeB64Decode
|
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 |
@uses jsonEncode @uses urlsafeB64Encode
|
static |
Decode a JSON string into a PHP object.
string | $input | 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.
|
static |
|
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' |
DomainException | Unsupported algorithm was specified |
|
static |
|
static |
|
static |
|
static |
|
static |