Static class that contains common utility functions for {@link Zend_OpenId_Consumer} and {@link Zend_OpenId_Provider}.
This class implements common utility functions that are used by both Consumer and Provider. They include functions for Diffie-Hellman keys generation and exchange, URL normalization, HTTP redirection and some others.
category | Zend |
---|---|
package | Zend_OpenId |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
absoluteUrl(string $url) : string
string
absilute or relative URL
string
btwoc(string $str) : string
Arbitrary precision integers MUST be encoded as big-endian signed two's complement binary strings. Henceforth, "btwoc" is a function that takes an arbitrary precision integer and returns its shortest big-endian two's complement representation. All integers that are used with Diffie-Hellman Key Exchange are positive. This means that the left-most bit of the two's complement representation MUST be zero. If it is not, implementations MUST add a zero byte at the front of the string.
string
binary representation of arbitrary precision integer
string
big-endian signed representationcomputeDhSecret(string $pub_key, mixed $dh) : string
string
other party's public value
mixed
Diffie-Hellman key
\Zend_OpenId_Exception |
---|
string
createDhKey(string $p, string $g, string $priv_key = null
) : mixed
string
prime number in binary representation
string
generator in binary representation
string
private key in binary representation
mixed
digest(string $func, string $data) : string
It returns RAW binary string.
This is a wrapper function that uses one of available internal function dependent on given PHP configuration. It may use various functions from ext/openssl, ext/hash, ext/mhash or ext/standard.
string
digest algorithm
string
data to sign
\Zend_OpenId_Exception |
---|
string
RAW digital signaturegetDhKeyDetails(mixed $dh) : array
mixed
Diffie-Hellman key
array
hashHmac(string $macFunc, string $data, string $secret) : string
string
name of selected hashing algorithm (sha1, sha256)
string
data to sign
string
shared secret key used for generating the HMAC variant of the message digest
string
RAW HMAC valuenormalize($id) : boolean
Returns true on success and false of failure.
Normalization is performed according to the following rules:
boolean
normalizeUrl($id) : boolean
The function gets URL argument by reference and modifies it. It returns true on success and false of failure.
boolean
paramsToQuery(array $params) : string
array
variable/value pairs
string
URL encoded query stringrandomBytes(integer $len) : string
integer
length of requested string
string
RAW random binary stringredirect(string $url, array $params= null
, \Zend_Controller_Response_Abstract $response= null
, string $method= 'GET'
)
It may generate redirected request using GET or POST HTTP method. The function never returns.
string
URL to redirect to
array
additional variable/value pairs to send
\Zend_Controller_Response_Abstract
string
redirection method ('GET' or 'POST')
selfUrl() : string
string
setSelfUrl(string $selfUrl = null
) : string
string
the URL to be set
string
the old value of overriding URLstrlen(string $str) : integer
string
integer
the string lenghtbigNumToBin(mixed $bn) : string
mixed
big number
\Zend_OpenId_Exception |
---|
string
binToBigNum(string $bin) : mixed
string
binary representation of big number
\Zend_OpenId_Exception |
---|
mixed
$exitOnRedirect
true
$selfUrl
null
DH_G = '02'
DH_P = 'dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61ef75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d2683705577d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e3826634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab'
NS_2_0 = 'http://specs.openid.net/auth/2.0'