Elgg  Version master
Public Member Functions | Protected Attributes | List of all members
Elgg\Security\HmacFactory Class Reference

Provides a factory for HMAC objects. More...

Public Member Functions

 __construct (SiteSecret $secret, Crypto $crypto)
 Constructor. More...
 
 getHmac ($data, $algo= 'sha256', $key= '')
 Get an HMAC token builder/validator object. More...
 

Protected Attributes

 $site_secret
 
 $crypto
 

Detailed Description

Provides a factory for HMAC objects.

Definition at line 8 of file HmacFactory.php.

Constructor & Destructor Documentation

Elgg\Security\HmacFactory::__construct ( SiteSecret  $secret,
Crypto  $crypto 
)

Constructor.

Parameters
SiteSecret$secretSite secret
Crypto$cryptoElgg crypto service

Definition at line 26 of file HmacFactory.php.

Member Function Documentation

Elgg\Security\HmacFactory::getHmac (   $data,
  $algo = 'sha256',
  $key = '' 
)

Get an HMAC token builder/validator object.

Parameters
mixed$dataHMAC data or serializable data
string$algoHash algorithm
string$keyOptional key (default uses site secret)
Returns
Hmac

Definition at line 40 of file HmacFactory.php.

Member Data Documentation

Elgg\Security\HmacFactory::$crypto
protected

Definition at line 18 of file HmacFactory.php.

Elgg\Security\HmacFactory::$site_secret
protected

Definition at line 13 of file HmacFactory.php.


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