sodium_keys: sodium key management

Description Usage Arguments Details Examples

Description

Get and set the key for encryption and decryption

Usage

1
2
3
4
5
6
7

Arguments

key

string for encryption key

Details

sodium_set_key() sets the encryption key to key. It is stored as an option: 'cache.sodium.key'

sodium_get_key() retrieves the key. It returns NULL if no key has been set.

sodium_get_key_or_ask() retrieves the key. If no key has been set and the session is interactive, the user is prompted for the key.

cache_sodium_key() can be used to set the sodium key if key is provided. Otherwise it is retrieved. This matches the cache-style accessors.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

decisionpatterns/cache.sodium documentation built on May 27, 2020, 3:21 a.m.