API Documentation

Crypt/Hmac.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Crypt
subpackage
Hmac
version
$Id: Hmac.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Crypt_Hmac

Description

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.

Zend_Crypt_Hmac

Extends from
Zend_Crypt
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Crypt
todo
Patch for refactoring failed tests (key block sizes >80 using internal algo)
todo
Check if mhash() is a required alternative (will be PECL-only soon)
Constants
STRING
BINARY
Properties
$_key
$_packFormat
$_hashAlgorithm
$_supportedMhashAlgorithms
Methods
compute
_setHashAlgorithm
_hash
_getMhashDefinition

Description

PHP implementation of the RFC 2104 Hash based Message Authentication Code algorithm.

Constants

STRING

 STRING = 'string'

Constants representing the output mode of the hash algorithm

Details

value
string

BINARY

 BINARY = 'binary'

Details

value
binary

Properties

$_hashAlgorithm

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().

Details

$_hashAlgorithm
string
visibility
protected
default
md5
final
false
static
true

$_key

string $_key = 'null'

The key to use for the hash

Details

$_key
string
visibility
protected
default
null
final
false
static
true

$_packFormat

string $_packFormat = 'null'

pack() format to be used for current hashing method

Details

$_packFormat
string
visibility
protected
default
null
final
false
static
true

$_supportedMhashAlgorithms

array $_supportedMhashAlgorithms = 'array'

List of algorithms supported my mhash()

Details

$_supportedMhashAlgorithms
array
visibility
protected
default
array
final
false
static
true

Methods

_getMhashDefinition

_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.

Arguments
$hashAlgorithm
string
Output
integer
Details
visibility
protected
final
false
static
true

_hash

_hash( string $data, string $output = self, bool $internal = false ) : string

Perform HMAC and return the keyed data

Arguments
$data
string
$output
string
$internal
bool
Option to not use hash() functions for testing
Output
string
Details
visibility
protected
final
false
static
true

_setHashAlgorithm

_setHashAlgorithm( string $hash ) : Zend_Crypt_Hmac

Setter for the hash method.

Arguments
$hash
string
Details
visibility
protected
final
false
static
true

compute

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.

Arguments
$key
string
$hash
string
$data
string
$output
string
Output
string
Details
visibility
public
final
false
static
true
Documentation was generated by DocBlox.