cache = $cacheFactory->createLocal('encryption-setup'); } /** * @param string $uid user id * @param string $password user password * @return bool */ public function setupUser($uid, $password) { if (!$this->keyManager->userHasKeys($uid)) { $keyPair = $this->crypt->createKeyPair(); return is_array($keyPair) ? $this->keyManager->storeKeyPair($uid, $password, $keyPair) : false; } return true; } /** * make sure that all system keys exists */ public function setupSystem() { if (!$this->cache->get('keys-validated')) { $this->keyManager->validateShareKey(); $this->keyManager->validateMasterKey(); $this->cache->set('keys-validated', true); } } }