private function checkSignature($signature, $status, $code)
    {
        if (!$signature) {
            throw new EndpointException("Invalid signature");
        }
      
        $data = $this->app->getAppId() . $this->requestId . $this->connectId . $code . $status;
        $result = openssl_verify($data, $signature, $this->app->getSecretKey(), OPENSSL_ALGO_SHA512);
        
        if ($result < 1) {
            $errstr = openssl_error_string();

            throw new EndpointException("Invalid signature or an openssl error (" . ($errstr ? $errstr : "-") . ")");
        }
    }