Encryption adapter for openssl

 Methods

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

__construct(string | array | \Traversable $options) 

Parameters

$options

stringarray\Traversable

Options for this adapter

Exceptions

\Zend\Filter\Exception\ExtensionNotLoadedException

Defined by Zend\Filter\FilterInterface

decrypt(string $value) : string

Decrypts $value with the defined settings

Parameters

$value

string

Content to decrypt

Exceptions

\Zend\Filter\Exception\RuntimeException

Returns

stringThe decrypted content

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

encrypt(string $value) : string

Parameters

$value

string

Content to encrypt

Exceptions

\Zend\Filter\Exception\RuntimeException

Returns

stringThe encrypted content

Returns the compression

getCompression() : array

Returns

array

Returns all envelope keys

getEnvelopeKey() : array

Returns

array

Returns if header should be packaged

getPackage() : bool

Returns

bool

Returns the passphrase

getPassphrase() : string

Returns

string

Returns all private keys

getPrivateKey() : array

Returns

array

Returns all public keys

getPublicKey() : array

Returns

array

Sets a internal compression for values to encrypt

setCompression(string | array $compression) : \Zend\Filter\Encrypt\Openssl

Parameters

$compression

stringarray

Returns

Sets envelope keys

setEnvelopeKey(string | array $key) : \Zend\Filter\Encrypt\Openssl

Parameters

$key

stringarray

Envelope keys

Returns

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

setPackage(bool $package) : \Zend\Filter\Encrypt\Openssl

Parameters

$package

bool

Returns

Sets a new passphrase

setPassphrase(string $passphrase) : \Zend\Filter\Encrypt\Openssl

Parameters

$passphrase

string

Returns

Sets private keys

setPrivateKey(string $key, string $passphrase) : \Zend\Filter\Encrypt\Openssl

Parameters

$key

string

Private key

$passphrase

string

Returns

Sets public keys

setPublicKey(string | array $key) : \Zend\Filter\Encrypt\Openssl

Parameters

$key

stringarray

Public keys

Returns

Returns the adapter name

toString() : string

Returns

string

Sets the encryption keys

_setKeys(string | array $keys) : \Zend\Filter\Encrypt\Openssl

Parameters

$keys

stringarray

Key with type association

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

 Properties

 

Internal compression

$compression : array

 

Definitions for encryption array( 'public' => public keys 'private' => private keys 'envelope' => resulting envelope keys )

$keys 

 

Internal create package

$package : bool

 

Internal passphrase

$passphrase : string