Documentation

SodiumMarshaller
in package
implements MarshallerInterface

Encrypt/decrypt values using Libsodium.

Tags
author

Ahmed TAILOULOUTE ahmed.tailouloute@gmail.com

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

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

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
Return values
mixed

Search results