diff --git a/src/Socialbox/Classes/StandardMethods/Settings/SettingsSignatureExists.php b/src/Socialbox/Classes/StandardMethods/Settings/SettingsSignatureExists.php new file mode 100644 index 0000000..86a7c9d --- /dev/null +++ b/src/Socialbox/Classes/StandardMethods/Settings/SettingsSignatureExists.php @@ -0,0 +1,50 @@ +containsParameter('uuid')) + { + throw new MissingRpcArgumentException('uuid'); + } + + try + { + $uuid = Uuid::fromString($rpcRequest->getParameter('uuid')); + } + catch(InvalidArgumentException) + { + throw new InvalidRpcArgumentException('uuid'); + } + + try + { + return $rpcRequest->produceResponse(SigningKeysManager::signingKeyExists($request->getPeer()->getUuid(), $uuid)); + } + catch(DatabaseOperationException $e) + { + throw new StandardRpcException('Failed to check the signing key existence', StandardError::INTERNAL_SERVER_ERROR, $e); + } + + } + } \ No newline at end of file