Zend Framework
3.0
|
Encrypt using a symmetric cipher then authenticate using HMAC (SHA-256) More...
Public Member Functions | |
__construct (SymmetricInterface $cipher) | |
Constructor. | |
setCipher (SymmetricInterface $cipher) | |
Set the symmetric cipher. | |
getCipher () | |
Get symmetric cipher. | |
setKeyIteration ($num) | |
Set the number of iterations for Pbkdf2. | |
getKeyIteration () | |
Get the number of iterations for Pbkdf2. | |
setSalt ($salt) | |
Set the salt (IV) | |
getSalt () | |
Get the salt (IV) according to the size requested by the algorithm. | |
getOriginalSalt () | |
Get the original salt value. | |
setBinaryOutput ($value) | |
Enable/disable the binary output. | |
getBinaryOutput () | |
Get the value of binary output. | |
setKey ($key) | |
Set the encryption/decryption key. | |
getKey () | |
Get the key. | |
setCipherAlgorithm ($algo) | |
Set algorithm of the symmetric cipher. | |
getCipherAlgorithm () | |
Get the cipher algorithm. | |
getCipherSupportedAlgorithms () | |
Get the supported algorithms of the symmetric cipher. | |
setHashAlgorithm ($hash) | |
Set the hash algorithm for HMAC authentication. | |
getHashAlgorithm () | |
Get the hash algorithm for HMAC authentication. | |
setPbkdf2HashAlgorithm ($hash) | |
Set the hash algorithm for the Pbkdf2. | |
getPbkdf2HashAlgorithm () | |
Get the Pbkdf2 hash algorithm. | |
encrypt ($data) | |
Encrypt then authenticate using HMAC. | |
decrypt ($data) | |
Decrypt. | |
Static Public Member Functions | |
static | factory ($adapter, $options=[]) |
Factory. | |
static | getSymmetricPluginManager () |
Returns the symmetric cipher plugin manager. | |
static | setSymmetricPluginManager ($plugins) |
Set the symmetric cipher plugin manager. | |
Protected Attributes | |
$pbkdf2Hash = 'sha256' | |
$cipher | |
$hash = 'sha256' | |
$saltSetted = false | |
$binaryOutput = false | |
$keyIteration = 5000 | |
$key | |
Static Protected Attributes | |
static | $symmetricPlugins = null |
Encrypt using a symmetric cipher then authenticate using HMAC (SHA-256)
__construct | ( | SymmetricInterface | $cipher | ) |
Constructor.
SymmetricInterface | $cipher |
decrypt | ( | $data | ) |
Decrypt.
string | $data |
Exception\InvalidArgumentException |
encrypt | ( | $data | ) |
Encrypt then authenticate using HMAC.
string | $data |
Exception\InvalidArgumentException |
|
static |
getBinaryOutput | ( | ) |
Get the value of binary output.
getCipher | ( | ) |
Get symmetric cipher.
getCipherAlgorithm | ( | ) |
Get the cipher algorithm.
getCipherSupportedAlgorithms | ( | ) |
Get the supported algorithms of the symmetric cipher.
getHashAlgorithm | ( | ) |
Get the hash algorithm for HMAC authentication.
getKey | ( | ) |
Get the key.
getKeyIteration | ( | ) |
Get the number of iterations for Pbkdf2.
getOriginalSalt | ( | ) |
Get the original salt value.
getPbkdf2HashAlgorithm | ( | ) |
Get the Pbkdf2 hash algorithm.
getSalt | ( | ) |
Get the salt (IV) according to the size requested by the algorithm.
|
static |
Returns the symmetric cipher plugin manager.
If it doesn't exist it's created.
setBinaryOutput | ( | $value | ) |
setCipher | ( | SymmetricInterface | $cipher | ) |
setCipherAlgorithm | ( | $algo | ) |
Set algorithm of the symmetric cipher.
string | $algo |
Exception\InvalidArgumentException |
setHashAlgorithm | ( | $hash | ) |
Set the hash algorithm for HMAC authentication.
string | $hash |
Exception\InvalidArgumentException |
setKey | ( | $key | ) |
Set the encryption/decryption key.
string | $key |
Exception\InvalidArgumentException |
setKeyIteration | ( | $num | ) |
setPbkdf2HashAlgorithm | ( | $hash | ) |
Set the hash algorithm for the Pbkdf2.
string | $hash |
Exception\InvalidArgumentException |
setSalt | ( | $salt | ) |
Set the salt (IV)
string | $salt |
Exception\InvalidArgumentException |
|
static |
Set the symmetric cipher plugin manager.
string | SymmetricPluginManager | $plugins |
Exception\InvalidArgumentException |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |