private function generate($secret, $options = [])
    {
        if (!$secret) {
            throw new FilestackException("Secret can not be empty", 400);
        }

        // check that options passed in are valid (on allowed list)
        $this->validateOptions($options);

        // set encoded values to policy and signature
        $policy = json_encode($options);
        $policy = $this->urlsafeB64encode($policy);
        $signature = $this->createSignature($policy, $secret);

        return ['policy' => $policy, 'signature' => $signature];
    }