1 | <?php |
||
27 | abstract class KeyAbstract |
||
28 | { |
||
29 | /** @var StorageInterface */ |
||
30 | protected $storage; |
||
31 | |||
32 | /** @var string */ |
||
33 | protected $name; |
||
34 | |||
35 | /** |
||
36 | * KeyAbstract constructor. |
||
37 | * @param StorageInterface $storage key store |
||
38 | * @param string $name case insensitive key name, allow only A-Z, 0-9, _ and - |
||
39 | */ |
||
40 | 1 | public function __construct(StorageInterface $storage, $name) |
|
45 | |||
46 | /** |
||
47 | * get key for use in signing |
||
48 | * |
||
49 | * @return string signing key |
||
50 | */ |
||
51 | abstract public function getSigning(); |
||
52 | |||
53 | /** |
||
54 | * get key for use in verifying |
||
55 | * |
||
56 | * @return string verifying key |
||
57 | */ |
||
58 | abstract public function getVerifying(); |
||
59 | |||
60 | /** |
||
61 | * create the key and store it for use |
||
62 | * |
||
63 | * @return boolean true if key was created and stored, otherwise false |
||
64 | */ |
||
65 | abstract public function create(); |
||
66 | |||
67 | /** |
||
68 | * delete the key |
||
69 | * |
||
70 | * @return boolean true if key was deleted, otherwise false |
||
71 | */ |
||
72 | abstract public function kill(); |
||
73 | } |
||
74 |