public function getHmacSha1Signature(array $query = array())
    {
        //this is like the authorization params minus the realm and signature
        $params = array(
            'oauth_consumer_key' => $this->consumerKey,
            'oauth_token' => $this->requestToken,
            'oauth_signature_method' => self::HMAC_SHA1,
            'oauth_timestamp' => $this->time,
            'oauth_nonce' => $this->nonce,
            'oauth_version'     => self::OAUTH_VERSION,
            'oauth_verifier' => $this->verifier,
            'oauth_callback' => $this->callback);
        
        //if no token
        if (is_null($this->requestToken)) {
            //unset that parameter
            unset($params['oauth_token']);
        }
        
        //if no token
        if (is_null($this->verifier)) {
            //unset that parameter
            unset($params['oauth_verifier']);
        }
        
        //if no callback
        if (is_null($this->callback)) {
            //remove it
            unset($params['oauth_callback']);
        }
        
        $query = array_merge($params, $query); //merge the params and the query
        $query = $this->buildQuery($query); //make query into a string
        
        //create the base string
        $string = array($this->method, $this->encode($this->url), $this->encode($query));
        $string = implode('&', $string);
        
        //create the encryption key
        $key = $this->encode($this->consumerSecret) . '&' . $this->encode($this->requestSecret);
        
        //authentication method
        return base64_encode(hash_hmac('sha1', $string, $key, true));
    }