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.
Encryption adapter for openssl

$_keys= 'array(
'public' => array()'
Definitions for encryption array( 'public' => public keys 'private' => private keys 'envelope' => resulting envelope keys )
array(
'public' => array()
Details
__construct(
string|array $options
=
array()
)
:
void
Class constructor Available options 'public' => public key 'private' => private key 'envelope' => envelope key 'passphrase' => passphrase 'compression' => compress value with this compression adapter 'package' => pack envelope keys into encrypted string, simplifies decryption
Name | Type | Description |
---|---|---|
$options | string|array | Options for this adapter |

_setKeys(
string|array $keys
)
:
\Zend_Filter_Encrypt_Openssl
Sets the encryption keys
Name | Type | Description |
---|---|---|
$keys | string|array | Key with type association |
Type | Description |
---|---|
\Zend_Filter_Encrypt_Openssl |

decrypt(
string $value
)
:
string
Defined by Zend_Filter_Interface
Decrypts $value with the defined settings
Name | Type | Description |
---|---|---|
$value | string | Content to decrypt |
Type | Description |
---|---|
string | The decrypted content |
Exception | Description |
---|---|
\Zend_Filter_Exception |

encrypt(
string $value
)
:
string
Encrypts $value with the defined settings Note that you also need the "encrypted" keys to be able to decrypt
Name | Type | Description |
---|---|---|
$value | string | Content to encrypt |
Type | Description |
---|---|
string | The encrypted content |
Exception | Description |
---|---|
\Zend_Filter_Exception |

setCompression(
string|array $compression
)
:
\Zend_Filter_Encrypt_Openssl
Sets a internal compression for values to encrypt
Name | Type | Description |
---|---|---|
$compression | string|array |
Type | Description |
---|---|
\Zend_Filter_Encrypt_Openssl |

setPackage(
boolean $package
)
:
\Zend_Filter_Encrypt_Openssl
Sets if the envelope keys should be included in the encrypted value
Name | Type | Description |
---|---|---|
$package | boolean |
Type | Description |
---|---|
\Zend_Filter_Encrypt_Openssl |

setPassphrase(
string $passphrase
)
:
\Zend_Filter_Encrypt_Openssl
Sets a new passphrase
Name | Type | Description |
---|---|---|
$passphrase | string |
Type | Description |
---|---|
\Zend_Filter_Encrypt_Openssl |

setPrivateKey(
string $key, string $passphrase
=
null
)
:
\Zend_Filter_Encrypt_Openssl
Sets private keys
Name | Type | Description |
---|---|---|
$key | string | Private key |
$passphrase | string |
Type | Description |
---|---|
\Zend_Filter_Encrypt_Openssl |

setPublicKey(
string|array $key
)
:
\Zend_Filter_Encrypt_Openssl
Sets public keys
Name | Type | Description |
---|---|---|
$key | string|array | Public keys |
Type | Description |
---|---|
\Zend_Filter_Encrypt_Openssl |