Conditions | 6 |
Paths | 6 |
Total Lines | 27 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 2 | Features | 1 |
1 | <?php |
||
23 | public function findJWKSet(array $header) |
||
24 | { |
||
25 | if (!isset($header['x5u'])) { |
||
26 | return; |
||
27 | } |
||
28 | |||
29 | $content = $this->downloadContent($header['x5u']); |
||
30 | if (null === $content) { |
||
31 | return; |
||
32 | } |
||
33 | |||
34 | $content = json_decode($content, true); |
||
35 | if (!is_array($content)) { |
||
36 | return; |
||
37 | } |
||
38 | |||
39 | $jwk_set = ['keys']; |
||
40 | foreach ($content as $kid => $cert) { |
||
41 | $jwk = KeyConverter::loadKeyFromCertificate($cert); |
||
42 | if (null === $jwk) { |
||
43 | break; |
||
44 | } |
||
45 | $jwk_set['keys'][] = $jwk; |
||
46 | } |
||
47 | |||
48 | return $jwk_set; |
||
49 | } |
||
50 | |||
76 |