Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
19 | 1 | public function index() |
|
20 | { |
||
21 | 1 | $container = function_exists('app') ? app() : Container::getInstance(); |
|
22 | /** @var CryptKey $publicKey */ |
||
23 | 1 | $publicKey = $container->get('hello.keys.public'); |
|
24 | |||
25 | 1 | $key = new \stdClass(); |
|
26 | 1 | $key->alg = "RS256"; |
|
27 | 1 | $key->kty = "RSA"; |
|
28 | 1 | $key->use = "sig"; |
|
29 | 1 | $key->x5c = [file_get_contents($publicKey->getKeyPath())]; |
|
30 | 1 | $data = ['keys' => [$key]]; |
|
31 | |||
32 | 1 | return new JsonResponse($data); |
|
33 | } |
||
35 |