Ubiquity\security\data$Encryption This class is part of Ubiquity Inspired from illuminate/encryption package.
More...
|
static | getCipherFromKey (string $key) |
|
static | isValidKey (string $key, string $cipher) |
| Check if the given key and cipher combination is valid.
|
|
static | generateKey (string $cipher) |
| Generate a new key for the given cipher.
|
|
static | getMethods (?bool $aliases=null) |
|
|
| hash ($iv, $value) |
| Create a MAC for the given value.
|
|
| getJsonPayload ($payload) |
| Get the JSON array from the given payload.
|
|
| isValidPayload ($payload) |
| Check that the encryption payload is valid.
|
|
| isValidMac (array $payload) |
| Check if the MAC for the given payload is valid.
|
|
| calculateMac ($payload, $bytes) |
| Calculate the hash of the given payload.
|
|
Ubiquity\security\data$Encryption This class is part of Ubiquity Inspired from illuminate/encryption package.
- Author
- jc
- Version
- 1.0.0
Definition at line 18 of file Encryption.php.
◆ __construct()
__construct |
( |
?string |
$key = null , |
|
|
?string |
$cipher = null |
|
) |
| |
Create a new encrypter instance.
- Parameters
-
- Returns
- void
- Exceptions
-
RuntimeException
Definition at line 55 of file Encryption.php.
◆ calculateMac()
calculateMac |
( |
|
$payload, |
|
|
|
$bytes |
|
) |
| |
|
protected |
Calculate the hash of the given payload.
- Parameters
-
array | $payload | |
string | $bytes | |
- Returns
- string
Definition at line 137 of file Encryption.php.
◆ decrypt()
decrypt |
( |
string |
$payload, |
|
|
|
$unserialize = true |
|
) |
| |
Decrypt the given value.
- Parameters
-
string | $payload | |
bool | $unserialize | |
- Returns
- mixed
Definition at line 183 of file Encryption.php.
◆ decryptString()
decryptString |
( |
|
$payload | ) |
|
Decrypt the given string without unserialization.
- Parameters
-
- Returns
- string
Definition at line 202 of file Encryption.php.
◆ encrypt()
encrypt |
( |
|
$value, |
|
|
|
$serialize = true |
|
) |
| |
Encrypt the given value.
- Parameters
-
mixed | $value | |
bool | $serialize | |
- Returns
- string
Definition at line 149 of file Encryption.php.
◆ encryptString()
encryptString |
( |
string |
$value | ) |
|
Encrypt a string without serialization.
- Parameters
-
- Returns
- string
Definition at line 171 of file Encryption.php.
◆ generateKey()
static generateKey |
( |
string |
$cipher | ) |
|
|
static |
Generate a new key for the given cipher.
- Parameters
-
- Returns
- string
Definition at line 224 of file Encryption.php.
◆ getCipher()
◆ getCipherFromKey()
static getCipherFromKey |
( |
string |
$key | ) |
|
|
static |
◆ getJsonPayload()
getJsonPayload |
( |
|
$payload | ) |
|
|
protected |
Get the JSON array from the given payload.
- Parameters
-
- Returns
- array
Definition at line 97 of file Encryption.php.
◆ getKey()
◆ getMethods()
static getMethods |
( |
?bool |
$aliases = null | ) |
|
|
static |
◆ hash()
Create a MAC for the given value.
- Parameters
-
- Returns
- string
Definition at line 87 of file Encryption.php.
◆ initializeKeyAndCipher()
initializeKeyAndCipher |
( |
| ) |
|
◆ isValidKey()
static isValidKey |
( |
string |
$key, |
|
|
string |
$cipher |
|
) |
| |
|
static |
Check if the given key and cipher combination is valid.
- Parameters
-
- Returns
- bool
Definition at line 213 of file Encryption.php.
◆ isValidMac()
isValidMac |
( |
array |
$payload | ) |
|
|
protected |
Check if the MAC for the given payload is valid.
- Parameters
-
- Returns
- bool
Definition at line 125 of file Encryption.php.
◆ isValidPayload()
isValidPayload |
( |
|
$payload | ) |
|
|
protected |
Check that the encryption payload is valid.
- Parameters
-
- Returns
- bool
Definition at line 115 of file Encryption.php.
◆ $acceptedCiphers
◆ $cipher
◆ $key
◆ AES128
const AES128 = 'AES-128-CBC' |
◆ AES192
const AES192 = 'AES-192-CBC' |
◆ AES256
const AES256 = 'AES-256-CBC' |
The documentation for this class was generated from the following file:
- C:/Users/myadd/Documents/GitHub/ubiquity-doc-api/vendor/phpmv/ubiquity-security/src/Ubiquity/security/data/Encryption.php