Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
17 | public function __construct(string $privateKey) |
||
18 | { |
||
19 | if (!preg_match('/^\-\-\-\-\-BEGIN PRIVATE KEY\-\-\-\-\-[\S\n]+\-\-\-\-\-END PRIVATE KEY\-\-\-\-\-$/', $privateKey)) { |
||
20 | throw new InvalidArgumentException("Invalid PrivateKey format. Please use a shielded format"); |
||
21 | } |
||
22 | |||
23 | $this->key = $privateKey; |
||
24 | } |
||
25 | |||
43 |