Component for creating HMAC tokens.  
 More...
Component for creating HMAC tokens. 
Definition at line 10 of file Hmac.php.
◆ __construct()
      
        
          | 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.
 
 
◆ getToken()
      
        
          | Elgg\Security\Hmac::getToken | ( |  | ) |  | 
      
 
Get the HMAC token in Base64URL encoding. 
- Returns
- string 
Definition at line 47 of file Hmac.php.
 
 
◆ matchesToken()
      
        
          | 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.
 
 
◆ $comparator
  
  | 
        
          | Elgg\Security\Hmac::$comparator |  | protected | 
 
 
◆ $data
  
  | 
        
          | string Elgg\Security\Hmac::$data |  | protected | 
 
 
The documentation for this class was generated from the following file: