public function isSignatureValid(string $response, string $signature, string $publicKey) : bool
    {
        if (\strlen($publicKey) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES) {
            throw new InvalidArgumentException(sprintf("Public key should be %d bytes.", SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES));
        }

        if (\strlen($signature) !== 64) {
            throw new InvalidArgumentException(sprintf("Signature %d bytes.", 64));
        }

        try {
            return \sodium_crypto_sign_verify_detached(
                $signature,
                $response,
                $publicKey
            );
        } catch (SodiumException $e) {
            throw new InvalidArgumentException($e->getMessage());
        }
    }