apps/files_external/lib/Lib/Auth/PublicKey/RSA.php 1 location
|
@@ 59-66 (lines=8) @@
|
| 56 |
|
; |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
| 60 |
|
$auth = new RSACrypt(); |
| 61 |
|
$auth->setPassword($this->config->getSystemValue('secret', '')); |
| 62 |
|
if (!$auth->loadKey($storage->getBackendOption('private_key'))) { |
| 63 |
|
throw new \RuntimeException('unable to load private key'); |
| 64 |
|
} |
| 65 |
|
$storage->setBackendOption('public_key_auth', $auth); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
/** |
| 69 |
|
* Generate a keypair |
apps/files_external/lib/Lib/Auth/PublicKey/RSAPrivateKey.php 1 location
|
@@ 57-64 (lines=8) @@
|
| 54 |
|
]); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
| 58 |
|
$auth = new RSACrypt(); |
| 59 |
|
$auth->setPassword($this->config->getSystemValue('secret', '')); |
| 60 |
|
if (!$auth->loadKey($storage->getBackendOption('private_key'))) { |
| 61 |
|
throw new \RuntimeException('unable to load private key'); |
| 62 |
|
} |
| 63 |
|
$storage->setBackendOption('public_key_auth', $auth); |
| 64 |
|
} |
| 65 |
|
} |
| 66 |
|
|