| Conditions | 3 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function sign(string $message): string |
||
| 26 | { |
||
| 27 | $signature = ''; |
||
| 28 | |||
| 29 | if (openssl_sign($message, $signature, $this->privateKey->getResource(), $this->algorithm()) === true) { |
||
| 30 | return $signature; |
||
| 31 | } |
||
| 32 | |||
| 33 | throw new SigningException(openssl_error_string() ?: "OpenSSL cannot sign the token."); |
||
| 34 | } |
||
| 49 |