SodiumHandler
extends BaseHandler
in package
SodiumHandler uses libsodium in encryption.
Tags
Table of Contents
- $blockSize : int
- Block size for padding message.
- $key : string
- Starter key
- $logger : LoggerInterface
- Logger instance to record error messages and warnings.
- __construct() : mixed
- Constructor
- __get() : mixed
- __get() magic, providing readonly access to some of our properties
- __isset() : bool
- __isset() magic, providing checking for some of our properties
- decrypt() : mixed
- {@inheritDoc}
- encrypt() : mixed
- {@inheritDoc}
- parseParams() : void
- Parse the $params before doing assignment.
- substr() : string
- Byte-safe substr()
Properties
$blockSize
Block size for padding message.
protected
int
$blockSize
= 16
$key
Starter key
protected
string
$key
= ''
$logger
Logger instance to record error messages and warnings.
protected
LoggerInterface
$logger
Methods
__construct()
Constructor
public
__construct([Encryption|null $config = null ]) : mixed
Parameters
- $config : Encryption|null = null
Return values
mixed —__get()
__get() magic, providing readonly access to some of our properties
public
__get(string $key) : mixed
Parameters
- $key : string
-
Property name
Return values
mixed —__isset()
__isset() magic, providing checking for some of our properties
public
__isset(string $key) : bool
Parameters
- $key : string
-
Property name
Return values
bool —decrypt()
{@inheritDoc}
public
decrypt(mixed $data[, mixed $params = null ]) : mixed
Parameters
- $data : mixed
- $params : mixed = null
Return values
mixed —encrypt()
{@inheritDoc}
public
encrypt(mixed $data[, mixed $params = null ]) : mixed
Parameters
- $data : mixed
- $params : mixed = null
Return values
mixed —parseParams()
Parse the $params before doing assignment.
protected
parseParams(array<string|int, mixed>|string|null $params) : void
Parameters
- $params : array<string|int, mixed>|string|null
Tags
Return values
void —substr()
Byte-safe substr()
protected
static substr(string $str, int $start[, int $length = null ]) : string
Parameters
- $str : string
- $start : int
- $length : int = null