1 | <?php |
||
22 | abstract class RSA implements KeyEncryptionInterface |
||
23 | { |
||
24 | /** |
||
25 | * Optimal Asymmetric Encryption Padding (OAEP). |
||
26 | */ |
||
27 | const ENCRYPTION_OAEP = 1; |
||
28 | |||
29 | /** |
||
30 | * Use PKCS#1 padding. |
||
31 | */ |
||
32 | const ENCRYPTION_PKCS1 = 2; |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | public function encryptKey(JWKInterface $key, $cek, array $complete_headers, array &$additional_headers) |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function decryptKey(JWKInterface $key, $encrypted_key, array $header) |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function getKeyManagementMode() |
||
86 | |||
87 | /** |
||
88 | * @param JWKInterface $key |
||
89 | */ |
||
90 | protected function checkKey(JWKInterface $key) |
||
94 | |||
95 | /** |
||
96 | * @return int |
||
97 | */ |
||
98 | abstract protected function getEncryptionMode(); |
||
99 | |||
100 | /** |
||
101 | * @return string |
||
102 | */ |
||
103 | abstract protected function getHashAlgorithm(); |
||
104 | } |
||
105 |