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\self

Parameters

$compression

stringarray

Returns

\Zend\Filter\Encrypt\self

Sets envelope keys

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

Parameters

$key

stringarray

Envelope keys

Returns

\Zend\Filter\Encrypt\self

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

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

Parameters

$package

bool

Returns

\Zend\Filter\Encrypt\self

Sets a new passphrase

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

Parameters

$passphrase

string

Returns

\Zend\Filter\Encrypt\self

Sets private keys

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

Parameters

$key

string

Private key

$passphrase

string

Returns

\Zend\Filter\Encrypt\self

Sets public keys

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

Parameters

$key

stringarray

Public keys

Returns

\Zend\Filter\Encrypt\self

Returns the adapter name

toString() : string

Returns

string

Sets the encryption keys

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

Parameters

$keys

stringarray

Key with type association

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\Encrypt\self

 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