| 1 | <?php |
||
| 17 | final class Dir implements DirectEncryptionInterface |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * {@inheritdoc} |
||
| 21 | */ |
||
| 22 | public function getCEK(JWKInterface $key) |
||
| 23 | { |
||
| 24 | if ('dir' !== $key->get('kty') || !$key->has('dir')) { |
||
| 25 | throw new \InvalidArgumentException('The key is not valid'); |
||
| 26 | } |
||
| 27 | |||
| 28 | return Base64Url::decode($key->get('dir')); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | public function getAlgorithmName() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * {@inheritdoc} |
||
| 41 | */ |
||
| 42 | public function getKeyManagementMode() |
||
| 46 | } |
||
| 47 |