public function updatePrivateKey($publicKey, $privateKey)
{
try {
$result = $this->getAclCollection()->updateOne(['publicKey' => $publicKey], ['$set' => ['privateKey' => $privateKey]]);
unset($this->publicKeys[$publicKey]);
return (bool) $result->getMatchedCount();
} catch (MongoException $e) {
throw new DatabaseException('Could not update key in database', 500, $e);
}
}