def _decrypt_message(self, msg, msg_signature, timestamp, nonce):
        """检验消息的真实性，并且获取解密后的明文

        :param msg: 密文，对应POST请求的数据
        :param msg_signature: 签名串，对应URL参数的msg_signature
        :param timestamp: 时间戳，对应URL参数的timestamp
        :param nonce: 随机串，对应URL参数的nonce
        :return: 解密后的原文
        """
        timestamp = to_binary(timestamp)
        nonce = to_binary(nonce)
        if isinstance(msg, six.string_types):
            try:
                msg = xmltodict.parse(to_text(msg))['xml']
            except Exception as e:
                raise ParseError(e)

        encrypt = msg['Encrypt']
        signature = get_sha1_signature(self.__token, timestamp, nonce, encrypt)
        if signature != msg_signature:
            raise ValidateSignatureError()
        return self.__pc.decrypt(encrypt, self.__id)
def _decrypt_message(self, msg, msg_signature, timestamp, nonce):
        """检验消息的真实性，并且获取解密后的明文

        :param msg: 密文，对应POST请求的数据
        :param msg_signature: 签名串，对应URL参数的msg_signature
        :param timestamp: 时间戳，对应URL参数的timestamp
        :param nonce: 随机串，对应URL参数的nonce
        :return: 解密后的原文
        """
        timestamp = to_binary(timestamp)
        nonce = to_binary(nonce)
        if isinstance(msg, six.string_types):
            try:
                msg = xmltodict.parse(to_text(msg))['xml']
            except Exception as e:
                raise ParseError(e)

        encrypt = msg['Encrypt']
        signature = get_sha1_signature(self.__token, timestamp, nonce, encrypt)
        if signature != msg_signature:
            raise ValidateSignatureError()
        return self.__pc.decrypt(encrypt, self.__id)
def _decrypt_message ( self , msg , msg_signature , timestamp , nonce ) : timestamp = to_binary ( timestamp ) nonce = to_binary ( nonce ) if isinstance ( msg , six . string_types ) : try : msg = xmltodict . parse ( to_text ( msg ) ) [ 'xml' ] except Exception as e : raise ParseError ( e ) encrypt = msg [ 'Encrypt' ] signature = get_sha1_signature ( self . __token , timestamp , nonce , encrypt ) if signature != msg_signature : raise ValidateSignatureError ( ) return self . __pc . decrypt ( encrypt , self . __id )
检验消息的真实性，并且获取解密后的明文

        :param msg: 密文，对应POST请求的数据
        :param msg_signature: 签名串，对应URL参数的msg_signature
        :param timestamp: 时间戳，对应URL参数的timestamp
        :param nonce: 随机串，对应URL参数的nonce
        :return: 解密后的原文
检验消息的真实性，并且获取解密后的明文