Zend Framework  1.12
Static Public Member Functions | Public Attributes | Static Protected Member Functions | Static Protected Attributes | List of all members
Zend_Crypt_Hmac Class Reference

Static Public Member Functions

static compute ($key, $hash, $data, $output=self::STRING)
 Performs a HMAC computation given relevant details such as Key, Hashing algorithm, the data to compute MAC of, and an output format of String, Binary notation or BTWOC.
 
- Static Public Member Functions inherited from Zend_Crypt
static hash ($algorithm, $data, $binaryOutput=false)
 

Public Attributes

const STRING = 'string'
 Constants representing the output mode of the hash algorithm.
 
const BINARY = 'binary'
 
- Public Attributes inherited from Zend_Crypt
const TYPE_OPENSSL = 'openssl'
 
const TYPE_HASH = 'hash'
 
const TYPE_MHASH = 'mhash'
 

Static Protected Member Functions

static _setHashAlgorithm ($hash)
 Setter for the hash method.
 
static _hash ($data, $output=self::STRING, $internal=false)
 Perform HMAC and return the keyed data.
 
static _getMhashDefinition ($hashAlgorithm)
 Since MHASH accepts an integer constant representing the hash algorithm we need to make a small detour to get the correct integer matching our algorithm's name.
 
- Static Protected Member Functions inherited from Zend_Crypt
static _detectHashSupport ($algorithm)
 
static _digestHash ($algorithm, $data, $binaryOutput)
 
static _digestMhash ($algorithm, $data, $binaryOutput)
 
static _digestOpenssl ($algorithm, $data, $binaryOutput)
 

Static Protected Attributes

static $_key = null
 
static $_packFormat = null
 
static $_hashAlgorithm = 'md5'
 
static $_supportedMhashAlgorithms
 
- Static Protected Attributes inherited from Zend_Crypt
static $_type = null
 
static $_supportedAlgosOpenssl
 
static $_supportedAlgosMhash
 

Member Function Documentation

static _getMhashDefinition (   $hashAlgorithm)
staticprotected

Since MHASH accepts an integer constant representing the hash algorithm we need to make a small detour to get the correct integer matching our algorithm's name.

Parameters
string$hashAlgorithm
Returns
integer
static _hash (   $data,
  $output = self::STRING,
  $internal = false 
)
staticprotected

Perform HMAC and return the keyed data.

Parameters
string$data
string$output
bool$internalOption to not use hash() functions for testing
Returns
string
static _setHashAlgorithm (   $hash)
staticprotected

Setter for the hash method.

Parameters
string$hash
Returns
Zend_Crypt_Hmac
static compute (   $key,
  $hash,
  $data,
  $output = self::STRING 
)
static

Performs a HMAC computation given relevant details such as Key, Hashing algorithm, the data to compute MAC of, and an output format of String, Binary notation or BTWOC.

Parameters
string$key
string$hash
string$data
string$output
boolean$internal
Returns
string

Member Data Documentation

$_hashAlgorithm = 'md5'
staticprotected
$_key = null
staticprotected
$_packFormat = null
staticprotected
$_supportedMhashAlgorithms
staticprotected
Initial value:
= array('adler32',' crc32', 'crc32b', 'gost',
'haval128', 'haval160', 'haval192', 'haval256', 'md4', 'md5', 'ripemd160',
'sha1', 'sha256', 'tiger', 'tiger128', 'tiger160')
const BINARY = 'binary'
const STRING = 'string'

Constants representing the output mode of the hash algorithm.