interface EncryptionServiceInterface in Encryption 8
Same name and namespace in other branches
- 2.x src/EncryptionServiceInterface.php \Drupal\encryption\EncryptionServiceInterface
Interface EncryptionServiceInterface.
@package Drupal\encryption
Hierarchy
- interface \Drupal\encryption\EncryptionServiceInterface
Expanded class hierarchy of EncryptionServiceInterface
All classes that implement EncryptionServiceInterface
1 file declares its use of EncryptionServiceInterface
- EncryptionServiceTest.php in tests/
src/ Kernel/ EncryptionServiceTest.php
File
- src/
EncryptionServiceInterface.php, line 10
Namespace
Drupal\encryptionView source
interface EncryptionServiceInterface {
/**
* Encrypt a value using the encryption key from settings.php.
*
* @param string $value
* The value tobe encrypted.
* @param bool $raw_output
* Should be set to TRUE if a raw output value is required. Otherwise, a
* url safe base64 encoded encoded string will be returned.
*
* @return string|null
* A Base64 encoded representation of the encrypted value or null if
* encryption fails for some reason.
*/
public function encrypt($value, $raw_output = FALSE);
/**
* Decrypt a value using the encryption key from settings.php.
*
* @param string $value
* An encrypted string.
* @param bool $raw_input
* Should be set to TRUE if the input value is not a base64 encoded/url safe
* string (Defaults to FALSE).
*
* @return string|null
* The decrypted value or null if decryption fails.
*/
public function decrypt($value, $raw_input = FALSE);
/**
* Gets the `$settings['encryption_key']` value from settings.php.
*
* @return string|null
* The encryption key or null if validation fails.
*/
public function getEncryptionKey();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EncryptionServiceInterface:: |
public | function | Decrypt a value using the encryption key from settings.php. | |
EncryptionServiceInterface:: |
public | function | Encrypt a value using the encryption key from settings.php. | |
EncryptionServiceInterface:: |
public | function | Gets the `$settings['encryption_key']` value from settings.php. |