| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 1 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 53 | 2 | public function buildSignature(string $signatureBase, Consumer $consumer, Token $token) |
|
| 54 | { |
||
| 55 | 2 | $certificate = openssl_pkey_get_private('file://' . $this->privateKey); |
|
| 56 | 2 | $privateKeyId = openssl_pkey_get_private($certificate); |
|
| 57 | |||
| 58 | 2 | $signature = null; |
|
| 59 | |||
| 60 | 2 | openssl_sign($signatureBase, $signature, $privateKeyId, OPENSSL_ALGO_SHA1); |
|
| 61 | 2 | openssl_free_key($privateKeyId); |
|
|
|
|||
| 62 | |||
| 63 | 2 | return base64_encode($signature); |
|
| 64 | } |
||
| 66 |