1 | <?php |
||
6 | trait OpenSslEncryptionTrait |
||
7 | { |
||
8 | /** @var string */ |
||
9 | private $cipher; |
||
10 | /** @var mixed */ |
||
11 | private $decrypted; |
||
12 | |||
13 | 174 | public function get() |
|
21 | |||
22 | /** |
||
23 | * @return bool |
||
24 | */ |
||
25 | abstract public function isHit(); |
||
26 | |||
27 | /** |
||
28 | * @return CacheItemInterface |
||
29 | */ |
||
30 | abstract public function getDecorated(); |
||
31 | |||
32 | abstract protected function encrypt($data); |
||
33 | |||
34 | abstract protected function decrypt($data); |
||
35 | |||
36 | 222 | private function generateIv() |
|
42 | |||
43 | 222 | private function encryptString($string, $key, $iv) |
|
47 | |||
48 | 132 | private function decryptString($string, $method, $key, $iv) |
|
52 | |||
53 | 222 | private function getCipherMethod() |
|
57 | } |
||
58 |