| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | trait Algorithm |
||
| 11 | { |
||
| 12 | protected static string $name; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @inheritdoc |
||
| 16 | */ |
||
| 17 | public function name(): string |
||
| 18 | { |
||
| 19 | return static::$name; |
||
| 20 | } |
||
| 21 | |||
| 22 | protected function algorithm(): int |
||
| 23 | { |
||
| 24 | return [ |
||
| 25 | 'ES256' => OPENSSL_ALGO_SHA256, |
||
| 26 | 'ES256K' => OPENSSL_ALGO_SHA256, |
||
| 27 | 'ES384' => OPENSSL_ALGO_SHA512, |
||
| 28 | ][$this->name()]; |
||
| 29 | } |
||
| 30 | |||
| 31 | protected function keySize(): int |
||
| 38 | } |
||
| 39 | } |
||
| 40 |