def valida_assinatura(xml, arq_xml, tipo): if tipo not in ('NFe_110', 'CancNFe_107', 'InutNFe_107', 'ProcNFe_110', 'EnviNFe_110', 'NFe_200', 'CancNFe_200', 'InutNFe_200', 'ProcNFe_200', 'EnviNFe_200', 'NFe_310', 'InutNFe_310', 'ProcNFe_310', 'EnviNFe_310', 'CTe_104', 'CancCTe_104', 'InutCTe_104', 'ProcCTe_104', 'EnviCTe_104', 'Evento_100', 'EnvEvento_100', 'ProcEvento_100', 'EventoCCe_100', 'EnvEventoCCe_100', 'ProcEventoCCe_100', 'EventoCancNFe_100', 'EnvEventoCancNFe_100', 'ProcEventoCancNFe_100', 'EventoConfRecebimento_100', 'EnvEventoConfRecebimento_100', 'ProcEventoConfRecebimento_100'): return True assinatura_valida = False try: c = Certificado() assinatura_valida = c.verifica_assinatura_xml(xml) except: pass if not assinatura_valida: try: assinatura_valida = c.verifica_assinatura_arquivo(arq_xml) except: pass return assinatura_valida
def __init__(self): self.ambiente = 2 self.cidade = SIAFI_SOROCABA_SP self.certificado = Certificado() self.caminho = '' self.salvar_arquivos = True self.rps = RPS() self.caminho_temporario = '' self._servidor = '' self._url = '' self._soap_envio = None self._soap_retorno = None
def __init__(self): self.ambiente = 2 self.estado = u'SP' self.versao = u'1.10' self.certificado = Certificado() self.caminho = u'' self.salvar_arquivos = True self.contingencia_SCAN = False self.danfe = DANFE() self.caminho_temporario = u'' self._servidor = u'' self._url = u'' self._soap_envio = None self._soap_retorno = None
def __init__(self): self.ambiente = 2 self.estado = 'SP' self.versao = '2.00' self.certificado = Certificado() self.caminho = '' self.salvar_arquivos = True self.contingencia_SCAN = False self.danfe = DANFE() self.caminho_temporario = '' self.maximo_tentativas_consulta_recibo = 5 self._servidor = '' self._url = '' self._soap_envio = None self._soap_retorno = None