1 | <?php |
||
15 | abstract class SignatureAlgorithm implements |
||
16 | AlgorithmParameterValue, |
||
|
|||
17 | HeaderParameters |
||
18 | { |
||
19 | /** |
||
20 | * Compute signature. |
||
21 | * |
||
22 | * @param string $data Data for which the signature is computed |
||
23 | * @return string |
||
24 | */ |
||
25 | abstract public function computeSignature($data); |
||
26 | |||
27 | /** |
||
28 | * Validate signature. |
||
29 | * |
||
30 | * @param string $data Data to validate |
||
31 | * @param string $signature Signature to compare |
||
32 | * @return bool |
||
33 | */ |
||
34 | abstract public function validateSignature($data, $signature); |
||
35 | |||
36 | /** |
||
37 | * Initialize signature algorithm from a JWK and a header. |
||
38 | * |
||
39 | * @param JWK $jwk JSON Web Key |
||
40 | * @param Header $header Header |
||
41 | * @return SignatureAlgorithm |
||
42 | */ |
||
43 | 2 | public static function fromJWK(JWK $jwk, Header $header) { |
|
47 | } |
||
48 |