wechat_sdk/lib/crypto/cryptos.py
def _check_signature(self, msg_signature, timestamp, nonce, echostr):
        """验证签名有效性

        :param msg_signature: 签名串，对应URL参数的msg_signature
        :param timestamp: 时间戳，对应URL参数的timestamp
        :param nonce: 随机串，对应URL参数的nonce
        :param echostr: 随机串，对应URL参数的echostr
        :return: 解密之后的echostr
        :raise ValidateSignatureError: 签名无效异常
        """
        signature = get_sha1_signature(self.__token, timestamp, nonce, echostr)
        if not signature == msg_signature:
            raise ValidateSignatureError()
        try:
            return self.__pc.decrypt(echostr, self.__id)
        except DecryptAESError as e:
            raise ValidateSignatureError(e)
def _check_signature(self, msg_signature, timestamp, nonce, echostr):
        """验证签名有效性

        :param msg_signature: 签名串，对应URL参数的msg_signature
        :param timestamp: 时间戳，对应URL参数的timestamp
        :param nonce: 随机串，对应URL参数的nonce
        :param echostr: 随机串，对应URL参数的echostr
        :return: 解密之后的echostr
        :raise ValidateSignatureError: 签名无效异常
        """
        signature = get_sha1_signature(self.__token, timestamp, nonce, echostr)
        if not signature == msg_signature:
            raise ValidateSignatureError()
        try:
            return self.__pc.decrypt(echostr, self.__id)
        except DecryptAESError as e:
            raise ValidateSignatureError(e)
def _check_signature ( self , msg_signature , timestamp , nonce , echostr ) : signature = get_sha1_signature ( self . __token , timestamp , nonce , echostr ) if not signature == msg_signature : raise ValidateSignatureError ( ) try : return self . __pc . decrypt ( echostr , self . __id ) except DecryptAESError as e : raise ValidateSignatureError ( e )
验证签名有效性

        :param msg_signature: 签名串，对应URL参数的msg_signature
        :param timestamp: 时间戳，对应URL参数的timestamp
        :param nonce: 随机串，对应URL参数的nonce
        :param echostr: 随机串，对应URL参数的echostr
        :return: 解密之后的echostr
        :raise ValidateSignatureError: 签名无效异常
验证签名有效性