Total Complexity | 3 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | class SealedBox extends CryptoBox{ |
||
16 | |||
17 | public function create(string $message):CryptoBoxInterface{ |
||
18 | $this->checkKeypair(null, SODIUM_CRYPTO_BOX_PUBLICKEYBYTES); |
||
19 | |||
20 | $this->box = sodium_crypto_box_seal($this->checkMessage($message), $this->keypair->public); |
||
|
|||
21 | |||
22 | sodium_memzero($message); |
||
23 | |||
24 | return $this; |
||
25 | } |
||
26 | |||
27 | public function open(string $box_bin):CryptoBoxInterface{ |
||
41 | } |
||
42 | |||
44 |