1 | <?php |
||
8 | final class TokenKeyPair extends \yrc\redis\ActiveRecord |
||
9 | { |
||
10 | /** |
||
11 | * The default token type to create |
||
12 | * @const DEFAULT_TYPE |
||
13 | */ |
||
14 | const DEFAULT_TYPE = 1; |
||
15 | |||
16 | /** |
||
17 | * One time token types |
||
18 | * @const DEFAULT_TYPE |
||
19 | */ |
||
20 | const OTK_TYPE = 2; |
||
21 | |||
22 | /** |
||
23 | * The default expiration time for crypted tokens |
||
24 | * @const DEFAULT_EXPIRATION_TIME |
||
25 | */ |
||
26 | const DEFAULT_EXPIRATION_TIME = '+15 minutes'; |
||
27 | |||
28 | /** |
||
29 | * One time tokens have an expiration time of 5 minutes. On consumption are destroyed |
||
30 | * @const OKT_EXPIRATION_TIME |
||
31 | */ |
||
32 | const OTK_EXPIRATION_TIME = '+5 minutes'; |
||
33 | |||
34 | /** |
||
35 | * @inheritdoc |
||
36 | */ |
||
37 | public function attributes() |
||
48 | |||
49 | /** |
||
50 | * @return \Sodium\crypto_box_publickey |
||
51 | */ |
||
52 | public function getBoxPublicKey() |
||
56 | |||
57 | /** |
||
58 | * @return \Sodium\crypto_sign_publickey |
||
59 | */ |
||
60 | public function getSignPublicKey() |
||
64 | |||
65 | /** |
||
66 | * @return \Sodium\crypto_box_keypair |
||
67 | */ |
||
68 | public function getBoxKeyPair() |
||
74 | |||
75 | /** |
||
76 | * @return \Sodium\crypto_sign_keypair |
||
77 | */ |
||
78 | public function getSignKeyPair() |
||
84 | |||
85 | /** |
||
86 | * Generates a new crypt token |
||
87 | * @param int $type |
||
88 | * @return $array |
||
|
|||
89 | */ |
||
90 | public static function generate($type = TokenKeyPair::DEFAULT_TYPE) |
||
114 | } |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.