1 | <?php |
||
28 | final class JoseCollector extends DataCollector |
||
29 | { |
||
30 | /** |
||
31 | * @var AlgorithmManagerFactory |
||
32 | */ |
||
33 | private $algorithmManagerFactory; |
||
34 | |||
35 | /** |
||
36 | * @var CompressionMethodManagerFactory|null |
||
37 | */ |
||
38 | private $compressionMethodManagerFactory; |
||
39 | |||
40 | /** |
||
41 | * @var JWSSerializerManagerFactory|null |
||
42 | */ |
||
43 | private $jwsSerializerManagerFactory; |
||
44 | |||
45 | /** |
||
46 | * @var JWESerializerManagerFactory|null |
||
47 | */ |
||
48 | private $jweSerializerManagerFactory; |
||
49 | |||
50 | /** |
||
51 | * JoseCollector constructor. |
||
52 | * |
||
53 | * @param AlgorithmManagerFactory $algorithmManagerFactory |
||
54 | * @param CompressionMethodManagerFactory|null $compressionMethodManagerFactory |
||
55 | * @param JWSSerializerManagerFactory|null $jwsSerializerManagerFactory |
||
56 | * @param JWESerializerManagerFactory|null $jweSerializerManagerFactory |
||
57 | */ |
||
58 | public function __construct(AlgorithmManagerFactory $algorithmManagerFactory, ?CompressionMethodManagerFactory $compressionMethodManagerFactory = null, ?JWSSerializerManagerFactory $jwsSerializerManagerFactory = null, ?JWESerializerManagerFactory $jweSerializerManagerFactory = null) |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function collect(Request $request, Response $response, \Exception $exception = null) |
||
77 | |||
78 | /** |
||
79 | * @return array |
||
80 | */ |
||
81 | public function getAlgorithmDetails(): array |
||
85 | |||
86 | /** |
||
87 | * @return int |
||
88 | */ |
||
89 | public function countSignatureAlgorithms(): int |
||
93 | |||
94 | /** |
||
95 | * @return int |
||
96 | */ |
||
97 | public function countKeyEncryptionAlgorithms(): int |
||
101 | |||
102 | /** |
||
103 | * @return int |
||
104 | */ |
||
105 | public function countContentEncryptionAlgorithms(): int |
||
109 | |||
110 | /** |
||
111 | * @return array |
||
112 | */ |
||
113 | public function getCompressionMethodDetails(): array |
||
117 | |||
118 | /** |
||
119 | * @return array |
||
120 | */ |
||
121 | public function getJWSSerializationDetails(): array |
||
125 | |||
126 | /** |
||
127 | * @return array |
||
128 | */ |
||
129 | public function getJWESerializationDetails(): array |
||
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function getName() |
||
141 | |||
142 | /** |
||
143 | * |
||
144 | */ |
||
145 | private function collectSupportedAlgorithms() |
||
168 | |||
169 | /** |
||
170 | * @param AlgorithmInterface $algorithm |
||
171 | * @param int $signatureAlgorithms |
||
172 | * @param int $keyEncryptionAlgorithms |
||
173 | * @param int $contentEncryptionAlgorithms |
||
174 | * |
||
175 | * @return string |
||
176 | */ |
||
177 | private function getAlgorithmType(AlgorithmInterface $algorithm, int &$signatureAlgorithms, int &$keyEncryptionAlgorithms, int &$contentEncryptionAlgorithms): string |
||
196 | |||
197 | private function collectSupportedCompressionMethods() |
||
208 | |||
209 | private function collectSupportedJWSSerializations() |
||
220 | |||
221 | private function collectSupportedJWESerializations() |
||
232 | } |
||
233 |