1 | <?php |
||
23 | abstract class RSA implements SignatureAlgorithmInterface |
||
24 | { |
||
25 | /** |
||
26 | * Probabilistic Signature Scheme |
||
27 | */ |
||
28 | const SIGNATURE_PSS = 1; |
||
29 | |||
30 | /** |
||
31 | * Use the PKCS#1 |
||
32 | */ |
||
33 | const SIGNATURE_PKCS1 = 2; |
||
34 | |||
35 | /** |
||
36 | * @return mixed |
||
37 | */ |
||
38 | abstract protected function getAlgorithm(); |
||
39 | |||
40 | /** |
||
41 | * @return mixed |
||
42 | */ |
||
43 | abstract protected function getSignatureMethod(); |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function verify(JWKInterface $key, $input, $signature) |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function sign(JWKInterface $key, $input) |
||
88 | |||
89 | /** |
||
90 | * @param JWKInterface $key |
||
91 | */ |
||
92 | private function checkKey(JWKInterface $key) |
||
96 | |||
97 | /** |
||
98 | * @return \phpseclib\Crypt\RSA |
||
99 | */ |
||
100 | private function getRsaObject() |
||
110 | } |
||
111 |