@@ -31,35 +31,35 @@ |
||
| 31 | 31 | use OCA\Encryption\KeyManager; |
| 32 | 32 | |
| 33 | 33 | class Setup { |
| 34 | - /** @var Crypt */ |
|
| 35 | - private $crypt; |
|
| 36 | - /** @var KeyManager */ |
|
| 37 | - private $keyManager; |
|
| 34 | + /** @var Crypt */ |
|
| 35 | + private $crypt; |
|
| 36 | + /** @var KeyManager */ |
|
| 37 | + private $keyManager; |
|
| 38 | 38 | |
| 39 | - public function __construct(Crypt $crypt, |
|
| 40 | - KeyManager $keyManager) { |
|
| 41 | - $this->crypt = $crypt; |
|
| 42 | - $this->keyManager = $keyManager; |
|
| 43 | - } |
|
| 39 | + public function __construct(Crypt $crypt, |
|
| 40 | + KeyManager $keyManager) { |
|
| 41 | + $this->crypt = $crypt; |
|
| 42 | + $this->keyManager = $keyManager; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * @param string $uid user id |
|
| 47 | - * @param string $password user password |
|
| 48 | - * @return bool |
|
| 49 | - */ |
|
| 50 | - public function setupUser($uid, $password) { |
|
| 51 | - if (!$this->keyManager->userHasKeys($uid)) { |
|
| 52 | - $keyPair = $this->crypt->createKeyPair(); |
|
| 53 | - return is_array($keyPair) ? $this->keyManager->storeKeyPair($uid, $password, $keyPair) : false; |
|
| 54 | - } |
|
| 55 | - return true; |
|
| 56 | - } |
|
| 45 | + /** |
|
| 46 | + * @param string $uid user id |
|
| 47 | + * @param string $password user password |
|
| 48 | + * @return bool |
|
| 49 | + */ |
|
| 50 | + public function setupUser($uid, $password) { |
|
| 51 | + if (!$this->keyManager->userHasKeys($uid)) { |
|
| 52 | + $keyPair = $this->crypt->createKeyPair(); |
|
| 53 | + return is_array($keyPair) ? $this->keyManager->storeKeyPair($uid, $password, $keyPair) : false; |
|
| 54 | + } |
|
| 55 | + return true; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * make sure that all system keys exists |
|
| 60 | - */ |
|
| 61 | - public function setupSystem() { |
|
| 62 | - $this->keyManager->validateShareKey(); |
|
| 63 | - $this->keyManager->validateMasterKey(); |
|
| 64 | - } |
|
| 58 | + /** |
|
| 59 | + * make sure that all system keys exists |
|
| 60 | + */ |
|
| 61 | + public function setupSystem() { |
|
| 62 | + $this->keyManager->validateShareKey(); |
|
| 63 | + $this->keyManager->validateMasterKey(); |
|
| 64 | + } |
|
| 65 | 65 | } |