◆ __construct()
JsonWebToken constructor.
- Parameters
-
KeyAbstract | $key | key for signing/validating |
string | $algorithm | algorithm to use for signing/validating |
◆ create()
create |
( |
|
$payload, |
|
|
|
$expirationOffset = 0 |
|
) |
| |
Create a signed token string for a payload
- Parameters
-
array | \ArrayObject | $payload | traversable set of claims, claim => value |
int | $expirationOffset | seconds from now that token will expire. If not specified, an "exp" claim will not be added or updated |
- Returns
- string encoded and signed jwt string
- Exceptions
-
DomainException;
- Exceptions
-
InvalidArgumentException;
- Exceptions
-
UnexpectedValueException;
◆ decode()
decode |
( |
|
$jwtString, |
|
|
|
$assertClaims = array() |
|
) |
| |
Decode a JWT string, validating signature and well defined registered claims, and optionally validate against a list of supplied claims
- Parameters
-
string | $jwtString | string containing the JWT to decode |
array | \Traversable | $assertClaims | associative array, claim => value, of claims to assert |
- Returns
- object|false
◆ setAlgorithm()
setAlgorithm |
( |
|
$algorithm | ) |
|
- Parameters
-
string | $algorithm | algorithm to use for signing/validating |
- Returns
- JsonWebToken
- Exceptions
-
DomainException
◆ $algorithm
◆ $claims
◆ $key
The documentation for this class was generated from the following file: