Zend Framework
1.12
|
Public Member Functions | |
__construct ($prime, $generator, $privateKey=null, $privateKeyType=self::NUMBER) | |
Constructor; if set construct the object using the parameter array to set values for Prime, Generator and Private. | |
generateKeys () | |
Generate own public key. | |
setPublicKey ($number, $type=self::NUMBER) | |
Setter for the value of the public number. | |
getPublicKey ($type=self::NUMBER) | |
Returns own public key for communication to the second party to this transaction. | |
computeSecretKey ($publicKey, $type=self::NUMBER, $output=self::NUMBER) | |
Compute the shared secret key based on the public key received from the the second party to this transaction. | |
getSharedSecretKey ($type=self::NUMBER) | |
Return the computed shared secret key from the DiffieHellman transaction. | |
setPrime ($number) | |
Setter for the value of the prime number. | |
getPrime () | |
Getter for the value of the prime number. | |
setGenerator ($number) | |
Setter for the value of the generator number. | |
getGenerator () | |
Getter for the value of the generator number. | |
setPrivateKey ($number, $type=self::NUMBER) | |
Setter for the value of the private number. | |
getPrivateKey ($type=self::NUMBER) | |
Getter for the value of the private number. | |
hasPrivateKey () | |
Check whether a private key currently exists. | |
setBigIntegerMath ($extension=null) | |
Setter to pass an extension parameter which is used to create a specific BigInteger instance for a specific extension type. | |
Public Attributes | |
const | BINARY = 'binary' |
Constants. | |
const | NUMBER = 'number' |
const | BTWOC = 'btwoc' |
Static Public Attributes | |
static | $useOpenssl = true |
Protected Member Functions | |
_generatePrivateKey () | |
In the event a private number/key has not been set by the user, or generated by ext/openssl, a best attempt will be made to generate a random key. | |
__construct | ( | $prime, | |
$generator, | |||
$privateKey = null , |
|||
$privateKeyType = self::NUMBER |
|||
) |
Constructor; if set construct the object using the parameter array to set values for Prime, Generator and Private.
If a Private Key is not set, one will be generated at random.
string | $prime | |
string | $generator | |
string | $privateKey | |
string | $privateKeyType |
|
protected |
In the event a private number/key has not been set by the user, or generated by ext/openssl, a best attempt will be made to generate a random key.
Having a random number generator installed on linux/bsd is highly recommended! The alternative is not recommended for production unless without any other option.
computeSecretKey | ( | $publicKey, | |
$type = self::NUMBER , |
|||
$output = self::NUMBER |
|||
) |
Compute the shared secret key based on the public key received from the the second party to this transaction.
This should agree to the secret key the second party computes on our own public key. Once in agreement, the key is known to only to both parties. By default, the function expects the public key to be in binary form which is the typical format when being transmitted.
If you need the binary form of the shared secret key, call getSharedSecretKey() with the optional parameter for Binary output.
string | $publicKey | |
string | $type |
generateKeys | ( | ) |
Generate own public key.
If a private number has not already been set, one will be generated at this stage.
getGenerator | ( | ) |
Getter for the value of the generator number.
getPrime | ( | ) |
Getter for the value of the prime number.
getPrivateKey | ( | $type = self::NUMBER | ) |
Getter for the value of the private number.
string | $type |
getPublicKey | ( | $type = self::NUMBER | ) |
Returns own public key for communication to the second party to this transaction.
string | $type |
getSharedSecretKey | ( | $type = self::NUMBER | ) |
Return the computed shared secret key from the DiffieHellman transaction.
string | $type |
hasPrivateKey | ( | ) |
Check whether a private key currently exists.
setBigIntegerMath | ( | $extension = null | ) |
Setter to pass an extension parameter which is used to create a specific BigInteger instance for a specific extension type.
Allows manual setting of the class in case of an extension problem or bug.
string | $extension |
setGenerator | ( | $number | ) |
Setter for the value of the generator number.
string | $number |
setPrime | ( | $number | ) |
setPrivateKey | ( | $number, | |
$type = self::NUMBER |
|||
) |
Setter for the value of the private number.
string | $number | |
string | $type |
setPublicKey | ( | $number, | |
$type = self::NUMBER |
|||
) |
Setter for the value of the public number.
string | $number | |
string | $type |
|
static |
const BINARY = 'binary' |
Constants.
const BTWOC = 'btwoc' |
const NUMBER = 'number' |