Cookie Crypt Trait.
Provides the encrypt/decrypt logic for the CookieComponent.
array<string>Valid cipher names for encrypted cookies.
Helper method for validating encryption cipher names.
Decodes and decrypts a single value.
Decrypts $value using public $type method in Security class
Encrypts $value using public $type method in Security class
Explode method to return array from string set in CookieComponent::_implode() Maintains reading backwards compatibility with 1.x CookieComponent::_implode().
Returns the encryption key to be used.
Implode method to keep keys are multidimensional arrays
_checkCipher(string $encrypt): void
Helper method for validating encryption cipher names.
string $encrypt The cipher name.
voidRuntimeException_decode(string $value, string|false $encrypt, string|null $key): array|string
Decodes and decrypts a single value.
string $value The value to decode & decrypt.
string|false $encrypt The encryption cipher to use.
string|null $key Used as the security salt if specified.
array|string_decrypt(array<string>|string $values, string|false $mode, string|null $key = null): array|string
Decrypts $value using public $type method in Security class
array<string>|string $values Values to decrypt
string|false $mode Encryption mode
string|null $key optional Used as the security salt if specified.
array|string_encrypt(array|string $value, string|false $encrypt, string|null $key = null): string
Encrypts $value using public $type method in Security class
array|string $value Value to encrypt
string|false $encrypt Encryption mode to use. False disabled encryption.
string|null $key optional Used as the security salt if specified.
string_explode(string $string): array|string
Explode method to return array from string set in CookieComponent::_implode() Maintains reading backwards compatibility with 1.x CookieComponent::_implode().
string $string A string containing JSON encoded data, or a bare string.
array|string_getCookieEncryptionKey(): string
Returns the encryption key to be used.
string_implode(array $array): string
Implode method to keep keys are multidimensional arrays
array $array Map of key and values
stringValid cipher names for encrypted cookies.
array<string>
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/trait-Cake.Utility.CookieCryptTrait.html