Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 11 | public function createAES(?string $iv = null, ?string $key = null): Crypto |
|
21 | { |
||
22 | 11 | $iv ??= $this->randomCrypto->secureString(self::DEFAULT_LENGTH); |
|
23 | 11 | $key ??= $this->randomCrypto->secureString(self::DEFAULT_LENGTH); |
|
24 | |||
25 | 11 | $crypto = new AES(Crypto::MODE_CBC); |
|
26 | 11 | $crypto->setIV($iv); |
|
27 | 11 | $crypto->setKey($key); |
|
28 | |||
29 | 11 | return $crypto; |
|
30 | } |
||
32 |