1 | <?php |
||
21 | final class JWTLoader |
||
22 | { |
||
23 | /** |
||
24 | * @var \Jose\LoaderInterface |
||
25 | */ |
||
26 | private $loader; |
||
27 | |||
28 | /** |
||
29 | * @var \Jose\Checker\CheckerManagerInterface |
||
30 | */ |
||
31 | private $checker_manager; |
||
32 | |||
33 | /** |
||
34 | * @var \Jose\DecrypterInterface|null |
||
35 | */ |
||
36 | private $decrypter = null; |
||
37 | |||
38 | /** |
||
39 | * @var \Jose\VerifierInterface |
||
40 | */ |
||
41 | private $verifier; |
||
42 | |||
43 | /** |
||
44 | * JWTLoader constructor. |
||
45 | * |
||
46 | * @param \Jose\Checker\CheckerManagerInterface $checker_manager |
||
47 | * @param \Jose\VerifierInterface $verifier |
||
48 | * @param \Psr\Log\LoggerInterface|null $logger |
||
49 | */ |
||
50 | public function __construct(CheckerManagerInterface $checker_manager, VerifierInterface $verifier, LoggerInterface $logger = null) |
||
59 | |||
60 | /** |
||
61 | * @param \Jose\DecrypterInterface $decrypter |
||
62 | */ |
||
63 | public function enableDecryptionSupport(DecrypterInterface $decrypter) |
||
64 | { |
||
65 | $this->decrypter = $decrypter; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @return string[] |
||
70 | */ |
||
71 | public function getSupportedSignatureAlgorithms() |
||
75 | |||
76 | /** |
||
77 | * @return bool |
||
78 | */ |
||
79 | public function isDecryptionSupportEnabled() |
||
83 | |||
84 | /** |
||
85 | * @return string[] |
||
86 | */ |
||
87 | public function getSupportedKeyEncryptionAlgorithms() |
||
91 | |||
92 | /** |
||
93 | * @return string[] |
||
94 | */ |
||
95 | public function getSupportedContentEncryptionAlgorithms() |
||
99 | |||
100 | /** |
||
101 | * @return string[] |
||
102 | */ |
||
103 | public function getSupportedCompressionMethods() |
||
107 | |||
108 | /** |
||
109 | * @param string $assertion |
||
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, JWKSetInterface $encryption_key_set = null, $is_encryption_required = false) |
||
132 | |||
133 | /** |
||
134 | * @param \Jose\Object\JWSInterface $jws |
||
135 | * @param \Jose\Object\JWKSetInterface $signature_key_set |
||
136 | * @param string|null $detached_payload |
||
137 | * |
||
138 | * @return int |
||
139 | */ |
||
140 | public function verify(JWSInterface $jws, JWKSetInterface $signature_key_set, $detached_payload = null) |
||
151 | |||
152 | /** |
||
153 | * @param \Jose\Object\JWEInterface $jwe |
||
154 | * @param \Jose\Object\JWKSetInterface $encryption_key_set |
||
155 | * |
||
156 | * @return \Jose\Object\JWSInterface |
||
157 | */ |
||
158 | private function decryptAssertion(JWEInterface $jwe, JWKSetInterface $encryption_key_set) |
||
167 | } |
||
168 |
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):