Méthode |
Description |
|
__call ( string $name, array $args ) : Jwt |
Magic method for setting claims by name
Ex. "issuedAt()" calls Claims\IssuedAt |
|
__construct ( Header $header, ClaimsCollection $collection = null ) |
Initialize the object and set the header and claims collection
Empty claims collection is set if none is given |
|
__get ( string $name ) : mixed |
See if a claim type matches the requested property |
|
addClaim ( Claim $claim ) : Jwt |
Add a Claim to the current collection |
|
base64Decode ( string $data ) : string |
Base64 decode (and url decode) the given data |
|
base64Encode ( string $data ) : string |
Base64 encode data and prepare for the URL
NOTE: The "=" is removed as it's just padding in base64
and not needed. |
|
custom ( string | array $value, string $name = null ) : Jwt |
Allow for the insertion of multiple custom values at once |
|
decode ( string $data, boolean $verify = true ) : stdClass |
Decode the data with the given key
Optional "verify" parameter validates the signature as well (default is on) |
|
decrypt ( string $data, string $algorithm, string $iv, $key ) : string |
Decrypt given data wtih given key (and algorithm/IV) |
|
encode ( string $claims = null, $addIssued = false ) : string |
Encode the data, either given or from current object |
|
encrypt ( string $algorithm, string $iv, $key ) : string |
Encrypt the data with the given key (and algorithm/IV) |
|
getClaims ( ) : ClaimsCollection |
Get the current claims collection |
|
getHeader ( ) : Header |
Get the currently assigned header instance |
|
hash_equals ( $a, $b ) |
Polyfill PHP 5.6.0's hash_equals() feature |
|
setClaims ( ClaimsCollection $collection ) : Jwt |
Set the claims collection |
|
setHeader ( Header $header ) : Jwt |
Set the header instance |
|
sign ( string $signWith, string $key ) : string |
Generate the signature with the given data, key and algorithm |
|
verify ( string $key, stdClass $header, stdClass $claims, string $signature ) : boolean |
Verify the signature on the JWT message |
|