Elgg  Version 2.3
Public Member Functions | List of all members
Elgg\Security\Hmac Class Reference

Component for creating HMAC tokens. More...

Public Member Functions

 __construct ($key, callable $comparator, $data, $algo= 'sha256')
 Constructor. More...
 
 getToken ()
 Get the HMAC token in Base64URL encoding. More...
 
 matchesToken ($token)
 Does the MAC match the given token? More...
 

Detailed Description

Component for creating HMAC tokens.

Definition at line 7 of file Hmac.php.

Constructor & Destructor Documentation

Elgg\Security\Hmac::__construct (   $key,
callable  $comparator,
  $data,
  $algo = 'sha256' 
)

Constructor.

Parameters
string$keyHMAC key
callable$comparatorFunction that returns true if given two equal strings, else false
mixed$dataHMAC data string or serializable data
string$algoHash algorithm

Definition at line 37 of file Hmac.php.

Member Function Documentation

Elgg\Security\Hmac::getToken ( )

Get the HMAC token in Base64URL encoding.

Returns
string

Definition at line 55 of file Hmac.php.

Elgg\Security\Hmac::matchesToken (   $token)

Does the MAC match the given token?

Parameters
string$tokenHMAC token in Base64URL encoding
Returns
bool

Definition at line 66 of file Hmac.php.


The documentation for this class was generated from the following file: