containsParameter('peer')) { return $rpcRequest->produceError(StandardError::RPC_INVALID_ARGUMENTS, "Missing 'peer' parameter"); } if(!$rpcRequest->containsParameter('uuid')) { return $rpcRequest->produceError(StandardError::RPC_INVALID_ARGUMENTS, "Missing 'uuid' parameter"); } try { $uuid = Uuid::fromString($rpcRequest->getParameter('uuid')); } catch(InvalidArgumentException $e) { throw new StandardException('Invalid UUID', StandardError::RPC_INVALID_ARGUMENTS, $e); } // Parse the peer address try { $peerAddress = PeerAddress::fromAddress($rpcRequest->getParameter('peer')); } catch(InvalidArgumentException $e) { throw new StandardException('Peer Address Error: ' . $e->getMessage(), StandardError::RPC_INVALID_ARGUMENTS, $e); } try { return $rpcRequest->produceResponse(Socialbox::resolvePeerSignature($peerAddress, $uuid->toRfc4122())); } catch(StandardException $e) { throw $e; } catch (Exception $e) { throw new StandardException('Failed to resolve peer signature', StandardError::INTERNAL_SERVER_ERROR, $e); } } }