Total Complexity | 9 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
9 | final class EncryptionKey implements EncryptionKeyInterface |
||
10 | { |
||
11 | private $hashId; |
||
12 | private $key; |
||
13 | private $signingKey; |
||
14 | |||
15 | public function getHashIdentifier() : string |
||
18 | } |
||
19 | |||
20 | public function getBoxPublicKey() : string |
||
21 | { |
||
22 | return $this->key->getPublicKey(); |
||
23 | } |
||
24 | |||
25 | public function getBoxSecretKey() : string |
||
26 | { |
||
27 | return $this->key->getSecretKey(); |
||
28 | } |
||
29 | |||
30 | public function getBoxKeyPair() : Keypair |
||
31 | { |
||
32 | return $this->key; |
||
33 | } |
||
34 | |||
35 | public function getSigningPublicKey() : string |
||
36 | { |
||
37 | return $this->signingKey->getPublicKey(); |
||
38 | } |
||
39 | |||
40 | public function getSigningSecretKey() : string |
||
43 | } |
||
44 | |||
45 | public function getSigningKeyPair() : Keypair |
||
46 | { |
||
47 | return $this->signingKey; |
||
48 | } |
||
49 | |||
50 | public function isEphemeral() : bool |
||
53 | } |
||
54 | |||
55 | public static function generate($ephemeral = false) : EncryptionKeyInterface |
||
56 | { |
||
57 | $object = new static; |
||
58 | $object->hashId = \bin2hex(\random_bytes(32)); |
||
65 |