1 | <?php |
||
21 | final class JWTLoader |
||
22 | { |
||
23 | /** |
||
24 | * @var null|\Psr\Log\LoggerInterface |
||
25 | */ |
||
26 | private $logger; |
||
27 | |||
28 | /** |
||
29 | * @var \Jose\LoaderInterface |
||
30 | */ |
||
31 | private $loader; |
||
32 | |||
33 | /** |
||
34 | * @var \Jose\Checker\CheckerManagerInterface |
||
35 | */ |
||
36 | private $checker_manager; |
||
37 | |||
38 | /** |
||
39 | * @var \Jose\DecrypterInterface|null |
||
40 | */ |
||
41 | private $decrypter = null; |
||
42 | |||
43 | /** |
||
44 | * @var \Jose\VerifierInterface |
||
45 | */ |
||
46 | private $verifier; |
||
47 | |||
48 | /** |
||
49 | * JWTLoader constructor. |
||
50 | * |
||
51 | * @param \Jose\Checker\CheckerManagerInterface $checker_manager |
||
52 | * @param \Jose\VerifierInterface $verifier |
||
53 | * @param \Psr\Log\LoggerInterface|null $logger |
||
54 | */ |
||
55 | public function __construct(CheckerManagerInterface $checker_manager, VerifierInterface $verifier, LoggerInterface $logger = null) |
||
65 | |||
66 | /** |
||
67 | * @param \Jose\DecrypterInterface $decrypter |
||
68 | */ |
||
69 | public function enableEncryptionSupport(DecrypterInterface $decrypter) |
||
73 | |||
74 | /** |
||
75 | * @return string[] |
||
76 | */ |
||
77 | public function getSupportedSignatureAlgorithms() |
||
81 | |||
82 | /** |
||
83 | * @return string[] |
||
84 | */ |
||
85 | public function getSupportedKeyEncryptionAlgorithms() |
||
89 | |||
90 | /** |
||
91 | * @return string[] |
||
92 | */ |
||
93 | public function getSupportedContentEncryptionAlgorithms() |
||
97 | |||
98 | /** |
||
99 | * @return string[] |
||
100 | */ |
||
101 | public function getSupportedCompressionMethods() |
||
105 | |||
106 | /** |
||
107 | * @param string $assertion |
||
108 | * @param array $allowed_key_encryption_algorithms |
||
109 | * @param array $allowed_content_encryption_algorithms |
||
110 | * @param \Jose\Object\JWKSetInterface|null $encryption_key_set |
||
111 | * @param bool $is_encryption_required |
||
112 | * |
||
113 | * @return \Jose\Object\JWSInterface |
||
114 | */ |
||
115 | public function load($assertion, array $allowed_key_encryption_algorithms = [], array $allowed_content_encryption_algorithms = [], JWKSetInterface $encryption_key_set = null, $is_encryption_required = false) |
||
134 | |||
135 | /** |
||
136 | * @return bool |
||
137 | */ |
||
138 | private function isEncryptionSupportEnabled() |
||
142 | |||
143 | /** |
||
144 | * @param \Jose\Object\JWEInterface $jwe |
||
145 | * @param \Jose\Object\JWKSetInterface $encryption_key_set |
||
146 | * |
||
147 | * @return \Jose\Object\JWSInterface |
||
148 | */ |
||
149 | private function decryptAssertion(JWEInterface $jwe, JWKSetInterface $encryption_key_set) |
||
158 | |||
159 | /** |
||
160 | * @param \Jose\Object\JWSInterface $jws |
||
161 | * @param \Jose\Object\JWKSetInterface $signature_key_set |
||
162 | * @param array $allowed_signature_algorithms |
||
163 | */ |
||
164 | public function verifySignature(JWSInterface $jws, JWKSetInterface $signature_key_set, array $allowed_signature_algorithms) |
||
176 | } |
||
177 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):