public function getSignature($secret = null)
    {
        $signature = '';

        if($this->_algorithm)
        {
            $header  = $this->_toBase64url($this->_toJson($this->_header));
            $payload = $this->_toBase64url($this->_toJson($this->_claims));

            $message   = sprintf("%s.%s", $header, $payload);
            $signature = hash_hmac($this->_algorithm, $message, $secret, true);
        }

        return $signature;
    }