1 | <?php |
||
8 | final class EncryptionKey extends ActiveRecord |
||
9 | { |
||
10 | /** |
||
11 | * This is our default token lifespan |
||
12 | * @const TOKEN_EXPIRATION_TIME |
||
13 | */ |
||
14 | const OBJECT_EXPIRATION_TIME = '+15 minutes'; |
||
15 | |||
16 | /** |
||
17 | * Model attributes |
||
18 | * @return array |
||
19 | */ |
||
20 | public function attributes() |
||
29 | |||
30 | /** |
||
31 | * @return sodium_crypto_box_publickey |
||
32 | */ |
||
33 | public function getBoxPublicKey() |
||
37 | |||
38 | /** |
||
39 | * @return sodium_crypto_box_keypair |
||
40 | */ |
||
41 | public function getBoxKeyPair() |
||
47 | |||
48 | /** |
||
49 | * Helper method to return an encryption key |
||
50 | * @return EncryptionKey |
||
51 | */ |
||
52 | public static function generate() |
||
66 | } |