Filter/Encrypt/Openssl.php
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.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Filter
- Version
- $Id: Openssl.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Filter_Encrypt_Openssl
Package: Zend\FilterEncryption adapter for openssl
- Implements
- \Zend_Filter_Encrypt_Interface
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties



$_keys = array('public' => array(), 'private' => array(), 'envelope' => array())Definitions for encryption
array(
'public' => public keys
'private' => private keys
'envelope' => resulting envelope keys
)
Default valuearray('public' => array(), 'private' => array(), 'envelope' => array())Details- Type
- n/a
Methods



__construct(string | array $options = array()) : voidClass 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
Parameters| Name | Type | Description |
|---|
| $options | string | array | Options for this adapter |
|---|



_setKeys(string | array $keys) : \Zend_Filter_Encrypt_OpensslParameters| Name | Type | Description |
|---|
| $keys | string | array | Key with type association |
|---|
Returns 


decrypt(string $value) : stringDefined by Zend_Filter_Interface
Decrypts $value with the defined settings
Parameters| Name | Type | Description |
|---|
| $value | string | Content to decrypt |
|---|
Returns| Type | Description |
|---|
| string | The decrypted content |
Throws


encrypt(string $value) : stringEncrypts $value with the defined settings
Note that you also need the "encrypted" keys to be able to decrypt
Parameters| Name | Type | Description |
|---|
| $value | string | Content to encrypt |
|---|
Returns| Type | Description |
|---|
| string | The encrypted content |
Throws 


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


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


setPrivateKey(string $key, string $passphrase = null) : \Zend_Filter_Encrypt_OpensslParameters| Name | Type | Description |
|---|
| $key | string | Private key |
|---|
| $passphrase | string | |
|---|
Returns