def verifyJWT(self, token):
        """ 验证token
        @param token str unicode: 请求生成的token串
        >> 1. 验证并拆分token为header、payload、signature, 分别解码验证;
        >> 2. 验证header
        >> 3. payload一致性验证后, 验证过期时间;
        >> 4. 根据header、payload用密钥签名对比请求的signature;
        """
        logging.debug("verify token: {0}".format(token))
        #1. 拆分解析
        if isinstance(token, (str, unicode)):
            if token.count(".") == 2:
                token = self.analysisJWT(token)
            else:
                raise InvalidTokenError("invalid token")
        else:
            raise TypeError("token is in string or Unicode format")

        #2. 验证header
        if self._header == token["header"]:
            payload = token["payload"]
        else:
            raise InvalidTokenError("header missmatch")

        #3. 验证payload
        for i in self._payloadkey:
            if i in ("exp", "iat"): continue
            #logging.debug("verify payload key: {0}: {1}".format(i, payload.get(i) == self._payload.get(i)))
            if payload.get(i) != self._payload.get(i):
                raise InvalidTokenError("payload contains standard declaration keys")
        if self.get_current_timestamp() > payload["exp"]:
            raise TokenExpiredError("token expired")

        #4. 验证签名
        #头部编码
        first_part  = base64.urlsafe_b64encode(json.dumps(token["header"], sort_keys=True, separators=(',', ':')))
        #载荷消息体编码
        second_part = base64.urlsafe_b64encode(json.dumps(token["payload"], sort_keys=True, separators=(',', ':')))
        #签名以上两部分: 把header、playload的base64url编码加密后再次base64编码.
        third_part  = self.signatureJWT("{0}.{1}".format(first_part, second_part))
        #此处......
        if token["signature"] == third_part:
            logging.info("verify token pass")
            return True
        else:
            raise SignatureBadError("invalid signature")
验证token
        @param token str unicode: 请求生成的token串
        >> 1. 验证并拆分token为header、payload、signature, 分别解码验证;
        >> 2. 验证header
        >> 3. payload一致性验证后, 验证过期时间;
        >> 4. 根据header、payload用密钥签名对比请求的signature;