SodiumMarshaller
in package
implements
MarshallerInterface
Encrypt/decrypt values using Libsodium.
Tags
Interfaces, Classes and Traits
- MarshallerInterface
- Serializes/unserializes PHP values.
Table of Contents
- $decryptionKeys : mixed
- $marshaller : mixed
- __construct() : mixed
- isSupported() : bool
- marshall() : array<string|int, mixed>
- Serializes a list of values.
- unmarshall() : mixed
- Unserializes a single value and throws an exception if anything goes wrong.
Properties
$decryptionKeys
private
mixed
$decryptionKeys
$marshaller
private
mixed
$marshaller
Methods
__construct()
public
__construct(array<string|int, string> $decryptionKeys[, MarshallerInterface|null $marshaller = null ]) : mixed
Parameters
- $decryptionKeys : array<string|int, string>
-
The key at index "0" is required and is used to decrypt and encrypt values; more rotating keys can be provided to decrypt values; each key must be generated using sodium_crypto_box_keypair()
- $marshaller : MarshallerInterface|null = null
Return values
mixed —isSupported()
public
static isSupported() : bool
Return values
bool —marshall()
Serializes a list of values.
public
marshall(array<string|int, mixed> $values, array<string|int, mixed>|null &$failed) : array<string|int, mixed>
Parameters
- $values : array<string|int, mixed>
- $failed : array<string|int, mixed>|null
Return values
array<string|int, mixed> —unmarshall()
Unserializes a single value and throws an exception if anything goes wrong.
public
unmarshall(string $value) : mixed
Parameters
- $value : string