Code Duplication    Length = 8-9 lines in 2 locations

apps/encryption/lib/KeyManager.php 2 locations

@@ 395-403 (lines=9) @@
392
	 * @return string
393
	 * @throws PrivateKeyMissingException
394
	 */
395
	public function getPrivateKey($userId) {
396
		$privateKey = $this->keyStorage->getUserKey($userId,
397
			$this->privateKeyId, Encryption::ID);
398
399
		if (strlen($privateKey) !== 0) {
400
			return $privateKey;
401
		}
402
		throw new PrivateKeyMissingException($userId);
403
	}
404
405
	/**
406
	 * @param string $path
@@ 559-566 (lines=8) @@
556
	 * @return mixed
557
	 * @throws PublicKeyMissingException
558
	 */
559
	public function getPublicKey($userId) {
560
		$publicKey = $this->keyStorage->getUserKey($userId, $this->publicKeyId, Encryption::ID);
561
562
		if (strlen($publicKey) !== 0) {
563
			return $publicKey;
564
		}
565
		throw new PublicKeyMissingException($userId);
566
	}
567
568
	public function getPublicShareKeyId() {
569
		return $this->publicShareKeyId;