Component for creating HMAC tokens.
More...
Component for creating HMAC tokens.
Definition at line 10 of file Hmac.php.
Elgg\Security\Hmac::__construct |
( |
protected string |
$key, |
|
|
callable |
$comparator, |
|
|
|
$data, |
|
|
protected string |
$algo = 'sha256' |
|
) |
| |
Constructor.
- Parameters
-
string | $key | HMAC key |
callable | $comparator | Function that returns true if given two equal strings, else false |
mixed | $data | HMAC data string or serializable data |
string | $algo | Hash algorithm |
- Exceptions
-
Definition at line 29 of file Hmac.php.
Elgg\Security\Hmac::getToken |
( |
| ) |
|
Get the HMAC token in Base64URL encoding.
- Returns
- string
Definition at line 47 of file Hmac.php.
Elgg\Security\Hmac::matchesToken |
( |
|
$token | ) |
|
Does the MAC match the given token?
- Parameters
-
string | $token | HMAC token in Base64URL encoding |
- Returns
- bool
Definition at line 59 of file Hmac.php.
Elgg\Security\Hmac::$comparator |
|
protected |
string Elgg\Security\Hmac::$data |
|
protected |
The documentation for this class was generated from the following file: