SodiumMarshaller
in package
implements
MarshallerInterface
Encrypt/decrypt values using Libsodium.
Tags
Table of Contents
Interfaces
- MarshallerInterface
- Serializes/unserializes PHP values.
Properties
- $decryptionKeys : array<string|int, mixed>
- $marshaller : mixed
Methods
- __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
array<string|int, mixed>
$decryptionKeys
$marshaller
private
mixed
$marshaller
Methods
__construct()
public
__construct(array<string|int, string> $decryptionKeys[, MarshallerInterface $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
isSupported()
public
static isSupported() : bool
Return values
boolmarshall()
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