Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
PHP implementation of the RFC 2104 Hash based Message Authentication Code algorithm.
STRING = 'string'
Constants representing the output mode of the hash algorithm
BINARY = 'binary'
string $_hashAlgorithm = 'md5'
Hashing algorithm; can be the md5/sha1 functions or any algorithm name listed in the output of PHP 5.1.2+ hash_algos().
string $_key = 'null'
The key to use for the hash
string $_packFormat = 'null'
pack() format to be used for current hashing method
array $_supportedMhashAlgorithms = 'array'
List of algorithms supported my mhash()
_getMhashDefinition(
string $hashAlgorithm
)
:
integer
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.
_hash(
string $data, string $output
=
self, bool $internal
=
false
)
:
string
Perform HMAC and return the keyed data
_setHashAlgorithm(
string $hash
)
:
Zend_Crypt_Hmac
Setter for the hash method.
compute(
string $key, string $hash, string $data, string $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.