Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function toPEM() |
||
32 | { |
||
33 | $keys = $this->getKeys(); |
||
34 | $result = []; |
||
35 | |||
36 | foreach ($keys as $key) { |
||
37 | if (!in_array($key->get('kty'), ['RSA', 'EC'])) { |
||
38 | continue; |
||
39 | } |
||
40 | |||
41 | $pem = $this->getPEM($key); |
||
42 | if ($key->has('kid')) { |
||
43 | $result[$key->get('kid')] = $pem; |
||
44 | } else { |
||
45 | $result[] = $pem; |
||
46 | } |
||
47 | } |
||
48 | |||
49 | return $result; |
||
50 | } |
||
51 | |||
69 |