Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
EncryptionManager Class Reference

Ubiquity\security\data$EncryptionManager This class is part of Ubiquity. More...

Static Public Member Functions

static start (array &$config, ?string $cipher=Encryption::AES128)
 Start the manager and generate the encryption key.
 
static startProd (array $config, ?string $cypher=null)
 Start the encryption manager for production.
 
static encrypt ($data)
 Encrypt the given data.
 
static decryptString (string $data)
 Decrypt the given string.
 
static decrypt (string $data, $unserialize=true)
 Decrypt the given data with possible unserialization.
 
static generateKey (?string $cipher=Encryption::AES128)
 Generate a new encryption key.
 
static getKey ()
 
static getEncryptionInstance ()
 
static isStarted ()
 

Data Fields

const ENCRYPTION_KEY_NAME = 'encryption_key'
 

Static Private Member Functions

static getInstance (?string $key, ?string $cypher=Encryption::AES128)
 

Static Private Attributes

static $encryptionInstance
 

Detailed Description

Ubiquity\security\data$EncryptionManager This class is part of Ubiquity.

Author
jc
Version
1.0.2

Definition at line 16 of file EncryptionManager.php.

Member Function Documentation

◆ decrypt()

static decrypt ( string  $data,
  $unserialize = true 
)
static

Decrypt the given data with possible unserialization.

Parameters
string$data
boolean$unserialize
Returns
mixed|string

Definition at line 94 of file EncryptionManager.php.

◆ decryptString()

static decryptString ( string  $data)
static

Decrypt the given string.

Parameters
string$data
Returns
string

Definition at line 83 of file EncryptionManager.php.

◆ encrypt()

static encrypt (   $data)
static

Encrypt the given data.

Parameters
mixed$data
Returns
string

Definition at line 70 of file EncryptionManager.php.

◆ generateKey()

static generateKey ( ?string  $cipher = Encryption::AES128)
static

Generate a new encryption key.

Parameters
string$cipher
Returns
string

Definition at line 104 of file EncryptionManager.php.

◆ getEncryptionInstance()

static getEncryptionInstance ( )
static

Definition at line 112 of file EncryptionManager.php.

◆ getInstance()

static getInstance ( ?string  $key,
?string  $cypher = Encryption::AES128 
)
staticprivate

Definition at line 26 of file EncryptionManager.php.

◆ getKey()

static getKey ( )
static

Definition at line 108 of file EncryptionManager.php.

◆ isStarted()

static isStarted ( )
static

Definition at line 116 of file EncryptionManager.php.

◆ start()

static start ( array &  $config,
?string  $cipher = Encryption::AES128 
)
static

Start the manager and generate the encryption key.

Do not use in production

Parameters
array$config
?string$cipher

Definition at line 37 of file EncryptionManager.php.

◆ startProd()

static startProd ( array  $config,
?string  $cypher = null 
)
static

Start the encryption manager for production.

Parameters
array$config
?string$cypher

Definition at line 59 of file EncryptionManager.php.

Field Documentation

◆ $encryptionInstance

$encryptionInstance
staticprivate

Definition at line 24 of file EncryptionManager.php.

◆ ENCRYPTION_KEY_NAME

const ENCRYPTION_KEY_NAME = 'encryption_key'

Definition at line 18 of file EncryptionManager.php.


The documentation for this class was generated from the following file: