Class for encrypting data.
Definition at line 13 of file Cryptographer.php.
◆ __construct()
__construct |
( |
AnalyticsToken |
$analyticsToken, |
|
|
EncodedContextFactory |
$encodedContextFactory |
|
) |
| |
- Parameters
-
AnalyticsToken | $analyticsToken | |
EncodedContextFactory | $encodedContextFactory | |
Definition at line 38 of file Cryptographer.php.
42 $this->analyticsToken = $analyticsToken;
43 $this->encodedContextFactory = $encodedContextFactory;
◆ encode()
Encrypt input data.
- Parameters
-
- Returns
- EncodedContext
- Exceptions
-
Definition at line 53 of file Cryptographer.php.
58 }
catch (\Exception $e) {
59 throw new LocalizedException(
61 'The data is invalid. ' 62 .
'Enter the data as a string or data that can be converted into a string and try again.' 67 throw new LocalizedException(
__(
'The data is invalid. Enter the data as a string and try again.'));
69 if (!$this->validateCipherMethod($this->cipherMethod)) {
70 throw new LocalizedException(
__(
'The data is invalid. Use a valid cipher method and try again.'));
72 $initializationVector = $this->getInitializationVector();
74 $encodedContext = $this->encodedContextFactory->create([
75 'content' => openssl_encrypt(
82 'initializationVector' => $initializationVector,
85 return $encodedContext;
elseif(isset( $params[ 'redirect_parent']))
The documentation for this class was generated from the following file: