452. Class

452.1. Zend\Filter\Encrypt\Openssl

Encryption adapter for openssl

452.1.1. Methods

452.1.1.1. __construct

__construct()

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:string|array|Traversable – Options for this adapter
Throws ExceptionExtensionNotLoadedException:
 

452.1.1.2. _setKeys

_setKeys()

Sets the encryption keys

Parameters:string|array – Key with type association
Return type:Openssl
Throws :ExceptionInvalidArgumentException

452.1.1.3. getPublicKey

getPublicKey()

Returns all public keys

Return type:array

452.1.1.4. setPublicKey

setPublicKey()

Sets public keys

Parameters:string|array – Public keys
Return type:ZendFilterEncryptOpenssl

452.1.1.5. getPrivateKey

getPrivateKey()

Returns all private keys

Return type:array

452.1.1.6. setPrivateKey

setPrivateKey()

Sets private keys

Parameters:
  • string – Private key
  • string
Return type:

Openssl

452.1.1.7. getEnvelopeKey

getEnvelopeKey()

Returns all envelope keys

Return type:array

452.1.1.8. setEnvelopeKey

setEnvelopeKey()

Sets envelope keys

Parameters:string|array – Envelope keys
Return type:ZendFilterEncryptOpenssl

452.1.1.9. getPassphrase

getPassphrase()

Returns the passphrase

Return type:string

452.1.1.10. setPassphrase

setPassphrase()

Sets a new passphrase

Parameters:string
Return type:Openssl

452.1.1.11. getCompression

getCompression()

Returns the compression

Return type:array

452.1.1.12. setCompression

setCompression()

Sets a internal compression for values to encrypt

Parameters:string|array
Return type:Openssl

452.1.1.13. getPackage

getPackage()

Returns if header should be packaged

Return type:bool

452.1.1.14. setPackage

setPackage()

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

Parameters:bool
Return type:Openssl

452.1.1.15. encrypt

encrypt()

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

Parameters:string – Content to encrypt
Return type:string The encrypted content
Throws :ExceptionRuntimeException

452.1.1.16. decrypt

decrypt()

Defined by ZendFilterFilterInterface

Decrypts $value with the defined settings

Parameters:string – Content to decrypt
Return type:string The decrypted content
Throws :ExceptionRuntimeException

452.1.1.17. toString

toString()

Returns the adapter name

Return type:string