Documentation

Encryption extends BaseConfig
in package

Encryption configuration.

These are the settings used for encryption, if you don't pass a parameter array to the encrypter for creation/initialization.

Table of Contents

$blockSize  : int
-------------------------------------------------------------------------- SodiumHandler's Padding Length in Bytes --------------------------------------------------------------------------
$digest  : string
-------------------------------------------------------------------------- Encryption digest --------------------------------------------------------------------------
$driver  : string
-------------------------------------------------------------------------- Encryption Driver to Use --------------------------------------------------------------------------
$key  : string
-------------------------------------------------------------------------- Encryption Key Starter --------------------------------------------------------------------------
$registrars  : array<string|int, mixed>
An optional array of classes that will act as Registrars for rapidly setting config class properties.
$didDiscovery  : bool
Has module discovery happened yet?
$moduleConfig  : Modules
The modules configuration.
__construct()  : mixed
Will attempt to get environment variables with names that match the properties of the child class.
getEnvValue()  : mixed
Retrieve an environment-specific configuration setting
initEnvValue()  : mixed
Initialization an environment-specific configuration setting
registerProperties()  : mixed
Provides external libraries a simple way to register one or more options into a config file.

Properties

$blockSize

-------------------------------------------------------------------------- SodiumHandler's Padding Length in Bytes --------------------------------------------------------------------------

public int $blockSize = 16

This is the number of bytes that will be padded to the plaintext message before it is encrypted. This value should be greater than zero.

See the user guide for more information on padding.

$digest

-------------------------------------------------------------------------- Encryption digest --------------------------------------------------------------------------

public string $digest = 'SHA512'

HMAC digest to use, e.g. 'SHA512' or 'SHA256'. Default value is 'SHA512'.

$driver

-------------------------------------------------------------------------- Encryption Driver to Use --------------------------------------------------------------------------

public string $driver = 'OpenSSL'

One of the supported encryption drivers.

Available drivers:

  • OpenSSL
  • Sodium

$key

-------------------------------------------------------------------------- Encryption Key Starter --------------------------------------------------------------------------

public string $key = 'mpp3gZSGImM4r0Ne9iPRkSwmlNJDd1tg'

If you use the Encryption class you must set an encryption key (seed). You need to ensure it is long enough for the cipher and mode you plan to use. See the user guide for more info.

$registrars

An optional array of classes that will act as Registrars for rapidly setting config class properties.

public static array<string|int, mixed> $registrars = []

$didDiscovery

Has module discovery happened yet?

protected static bool $didDiscovery = false

Methods

__construct()

Will attempt to get environment variables with names that match the properties of the child class.

public __construct() : mixed

The "shortPrefix" is the lowercase-only config class name.

Return values
mixed

getEnvValue()

Retrieve an environment-specific configuration setting

protected getEnvValue(string $property, string $prefix, string $shortPrefix) : mixed
Parameters
$property : string
$prefix : string
$shortPrefix : string
Return values
mixed

initEnvValue()

Initialization an environment-specific configuration setting

protected initEnvValue(mixed &$property, string $name, string $prefix, string $shortPrefix) : mixed
Parameters
$property : mixed
$name : string
$prefix : string
$shortPrefix : string
Return values
mixed

registerProperties()

Provides external libraries a simple way to register one or more options into a config file.

protected registerProperties() : mixed
Tags
throws
ReflectionException
Return values
mixed

Search results