| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Jose\Component\KeyManagement\Analyzer; |
| 6 |
|
| 7 |
use Jose\Component\Core\JWK; |
| 8 |
|
| 9 |
class KeyAnalyzerManager |
| 10 |
{ |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
private array $analyzers = []; |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
public function add(KeyAnalyzer $analyzer): void |
| 20 |
{ |
| 21 |
$this->analyzers[] = $analyzer; |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
public function analyze(JWK $jwk): MessageBag |
| 28 |
{ |
| 29 |
$bag = new MessageBag(); |
| 30 |
foreach ($this->analyzers as $analyzer) { |
| 31 |
$analyzer->analyze($jwk, $bag); |
| 32 |
} |
| 33 |
|
| 34 |
return $bag; |
| 35 |
} |
| 36 |
} |