Total Complexity | 10 |
Total Lines | 59 |
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 getSignPublicKey() : string |
||
36 | { |
||
37 | return $this->signingKey->getPublicKey(); |
||
38 | } |
||
39 | |||
40 | public function getSignSecretKey() : string |
||
41 | { |
||
42 | return $this->signingKey->getSecretKey(); |
||
43 | } |
||
44 | |||
45 | public function getSignKeyPair() : Keypair |
||
46 | { |
||
47 | return $this->signingKey; |
||
48 | } |
||
49 | |||
50 | public function isEphemeral() : bool |
||
53 | } |
||
54 | |||
55 | public function getPublicKeyExpiration() : int |
||
56 | { |
||
57 | return \time(); |
||
58 | } |
||
59 | |||
60 | public static function generate($ephemeral = false) : EncryptionKeyInterface |
||
68 | } |
||
69 | } |
||
70 |