1 | <?php |
||
19 | abstract class AbstractSignatureReader extends Signature |
||
20 | { |
||
21 | /** @var XMLSecurityKey|null */ |
||
22 | protected $key; |
||
23 | |||
24 | /** |
||
25 | * @param XMLSecurityKey $key |
||
26 | * |
||
27 | * @return bool True if validated, False if validation was not performed |
||
28 | * |
||
29 | * @throws \LightSaml\Error\LightSamlSecurityException If validation fails |
||
30 | */ |
||
31 | abstract public function validate(XMLSecurityKey $key); |
||
32 | |||
33 | /** |
||
34 | * @return XMLSecurityKey|null |
||
35 | */ |
||
36 | 1 | public function getKey() |
|
40 | |||
41 | /** |
||
42 | * @param CredentialInterface[] $credentialCandidates |
||
43 | * |
||
44 | * @throws \InvalidArgumentException If element of $credentialCandidates array is not CredentialInterface |
||
45 | * @throws \LightSaml\Error\LightSamlSecurityException If validation fails |
||
46 | * |
||
47 | * @return CredentialInterface|null Returns credential that validated the signature or null if validation was not performed |
||
48 | */ |
||
49 | 1 | public function validateMulti(array $credentialCandidates) |
|
80 | |||
81 | /** |
||
82 | * @return string |
||
83 | */ |
||
84 | abstract public function getAlgorithm(); |
||
85 | |||
86 | /** |
||
87 | * @param XMLSecurityKey $key |
||
88 | * |
||
89 | * @return XMLSecurityKey |
||
90 | */ |
||
91 | 8 | protected function castKeyIfNecessary(XMLSecurityKey $key) |
|
110 | } |
||
111 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.