get_timeout()
get_timeout() : integer
Get the data expiry time in seconds
A utility class for caching encrypted information.
This class automatically calculates an encryption key with session specific entropy. However the encryption key can be overridden.
set_key(string $str)
Override the encryption key.
It is important to set this key with a long enough value and with enough entropy to be random for different purposes. i.e: if storing user specific data for a short time it may be appropriate to use the session id as part of the encryption key.
| string | $str |
put(string $data, string $key1, string $key2 = '', string $key3 = '')
Store encrypted data
| string | $data | The data to store |
| string | $key1 | The first key in the encrypted set. Up to three keys can be used |
| string | $key2 | The optional second key in the encrypted set |
| string | $key3 | The optional third key in the encrypted set |
put_special(string $data, string $specialkey, string $key1, string $key2 = '', string $key3 = '')
A convenience method to store data with a special encryption key.
| string | $data | The data to store |
| string | $specialkey | The override encryption key. |
| string | $key1 | The first key in the encrypted set. Up to three keys can be used |
| string | $key2 | The optional second key in the encrypted set |
| string | $key3 | The optional third key in the encrypted set |
get(string $key1, string $key2 = '', string $key3 = '') : string|null
unencrypt and return stored data
| string | $key1 | The first key in the encrypted set. Up to three keys can be used |
| string | $key2 | The optional second key in the encrypted set |
| string | $key3 | The optional third key in the encrypted set |
get_special(string $specialkey, string $key1, string $key2 = '', string $key3 = '') : \string.
unencrypt and return stored data using a special encryption key
| string | $specialkey | The override encryption key. |
| string | $key1 | The first key in the encrypted set. Up to three keys can be used |
| string | $key2 | The optional second key in the encrypted set |
| string | $key3 | The optional third key in the encrypted set |
erase(string $key1, string $key2 = '', string $key3 = '')
Erase encrypted data from the datastore
| string | $key1 | The first key in the encrypted set. Up to three keys can be used |
| string | $key2 | The optional second key in the encrypted set |
| string | $key3 | The optional third key in the encrypted set |