| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 11 | protected function createKey(): OpenSSLAsymmetricKey |
|
| 34 | { |
||
| 35 | 11 | $content = $this->getContent(); |
|
| 36 | 11 | $key = openssl_pkey_get_private($content, $this->password); |
|
| 37 | 11 | if (false === $key) { |
|
| 38 | 1 | throw new SignerException( |
|
| 39 | 1 | sprintf('"%s" is not valid PEM private key (or password is incorrect).', $this->file) |
|
| 40 | 1 | ); |
|
| 41 | } |
||
| 42 | |||
| 43 | 10 | return $key; |
|
|
1 ignored issue
–
show
|
|||
| 44 | } |
||
| 46 |