| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AESKW; |
| 6 | |
| 7 | interface Wrapper |
| 8 | { |
| 9 | /** |
| 10 | * @param string $kek The Key Encryption Key |
| 11 | * @param string $key The key to wrap |
| 12 | * @param bool $padding_enabled If false, the key to wrap must be a sequence of one or more 64-bit blocks (RFC3394 compliant), else the key size must be at least one octet (RFC5649 compliant) |
| 13 | * |
| 14 | * @return string The wrapped key |
| 15 | */ |
| 16 | public static function wrap(string $kek, string $key, bool $padding_enabled = false): string; |
| 17 | |
| 18 | /** |
| 19 | * @param string $kek The Key Encryption Key |
| 20 | * @param string $key The key to unwrap |
| 21 | * @param bool $padding_enabled If false, the AIV check must be RFC3394 compliant, else it must be RFC5649 or RFC3394 compliant |
| 22 | * |
| 23 | * @return string The key unwrapped |
| 24 | */ |
| 25 | public static function unwrap(string $kek, string $key, bool $padding_enabled = false): string; |
| 26 | } |