Filter/Encrypt/Openssl.php

Show: PublicProtectedPrivateinherited
Table of Contents
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-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Filter  
Version
$Id$  

\Zend_Filter_Encrypt_Openssl

Package: Zend_Filter
Encryption adapter for openssl
Implements
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedarray $_compression
Internal compression
Details
Type
array
>VPropertyprotected$_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
>VPropertyprotectedboolean $_package = false
Internal create package
Default valuefalseDetails
Type
boolean
>VPropertyprotectedstring $_passphrase
Internal passphrase
Details
Type
string

Methods

methodpublic__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

Parameters
NameTypeDescription
$optionsstring | array

Options for this adapter

methodprotected_setKeys(string | array $keys) : \Zend_Filter_Encrypt_Openssl

Sets the encryption keys

Parameters
NameTypeDescription
$keysstring | array

Key with type association

Returns
TypeDescription
\Zend_Filter_Encrypt_Openssl
methodpublicdecrypt(string $value) : string

Defined by Zend_Filter_Interface

Decrypts $value with the defined settings
Parameters
NameTypeDescription
$valuestring

Content to decrypt

Returns
TypeDescription
stringThe decrypted content
Throws
ExceptionDescription
\Zend_Filter_Exception
methodpublicencrypt(string $value) : string

Encrypts $value with the defined settings Note that you also need the "encrypted" keys to be able to decrypt

Parameters
NameTypeDescription
$valuestring

Content to encrypt

Returns
TypeDescription
stringThe encrypted content
Throws
ExceptionDescription
\Zend_Filter_Exception
methodpublicgetCompression() : array

Returns the compression

Returns
TypeDescription
array
methodpublicgetEnvelopeKey() : array

Returns all envelope keys

Returns
TypeDescription
array
methodpublicgetPackage() : boolean

Returns if header should be packaged

Returns
TypeDescription
boolean
methodpublicgetPassphrase() : string

Returns the passphrase

Returns
TypeDescription
string
methodpublicgetPrivateKey() : array

Returns all private keys

Returns
TypeDescription
array
methodpublicgetPublicKey() : array

Returns all public keys

Returns
TypeDescription
array
methodpublicsetCompression(string | array $compression) : \Zend_Filter_Encrypt_Openssl

Sets a internal compression for values to encrypt

Parameters
NameTypeDescription
$compressionstring | array
Returns
TypeDescription
\Zend_Filter_Encrypt_Openssl
methodpublicsetEnvelopeKey( $key) : \Zend_Filter_Encrypt_Openssl

Sets envelope keys

Parameters
NameTypeDescription
$key
Returns
TypeDescription
\Zend_Filter_Encrypt_Openssl
methodpublicsetPackage(boolean $package) : \Zend_Filter_Encrypt_Openssl

Sets if the envelope keys should be included in the encrypted value

Parameters
NameTypeDescription
$packageboolean
Returns
TypeDescription
\Zend_Filter_Encrypt_Openssl
methodpublicsetPassphrase(string $passphrase) : \Zend_Filter_Encrypt_Openssl

Sets a new passphrase

Parameters
NameTypeDescription
$passphrasestring
Returns
TypeDescription
\Zend_Filter_Encrypt_Openssl
methodpublicsetPrivateKey(string $key, string $passphrase = null) : \Zend_Filter_Encrypt_Openssl

Sets private keys

Parameters
NameTypeDescription
$keystring

Private key

$passphrasestring
Returns
TypeDescription
\Zend_Filter_Encrypt_Openssl
methodpublicsetPublicKey(string | array $key) : \Zend_Filter_Encrypt_Openssl

Sets public keys

Parameters
NameTypeDescription
$keystring | array

Public keys

Returns
TypeDescription
\Zend_Filter_Encrypt_Openssl
methodpublictoString() : string

Returns the adapter name

Returns
TypeDescription
string
Documentation was generated by phpDocumentor 2.2.0 .