Skip to content

Commit

Permalink
Correção na assinatura do xml
Browse files Browse the repository at this point in the history
  • Loading branch information
martini97 committed Oct 11, 2016
1 parent 482480f commit 92dcf2a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pytrustnfe/test/test_assinatura.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_assinar_xml_valido(self):
xml = signer.assina_xml(
etree.fromstring(XML_ASSINAR),
'NFe43150602261542000143550010000000761792265342')
xml_assinado = open(os.path.join(self.caminho, 'xml_assinado.xml'),
xml_assinado = open(os.path.join(self.caminho,
'xml_valido_assinado.xml'),
'r').read()
self.assertEqual(xml_assinado, xml, 'Xml assinado é inválido')
13 changes: 13 additions & 0 deletions pytrustnfe/test/xml_valido_assinado.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Envelope xmlns="urn:envelope"><Data Id="NFe43150602261542000143550010000000761792265342"> Hello, World! </Data><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><Reference URI="#NFe43150602261542000143550010000000761792265342"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>Ux0WbUl0+Ck1vAlonmbcqD+iO0o=</DigestValue></Reference></SignedInfo><SignatureValue>Df47e1lipDN9NM33YtjVqLHbeQFdQFy4T5VnJqEqHUlVb1EcphVPEDjyJLQmrsp93JRBTFrhzBjgNz643RMzYd00rOgH7ZN/zD4fp/WphLZyzT+8DqsleajxW4y9RgGjI5ceUdFCF16JATjTzvlBgi6jWBbtJArOqL1pKrQdlVk=</SignatureValue><KeyInfo><X509Data><X509Certificate>MIICMTCCAZqgAwIBAgIQfYOsIEVuAJ1FwwcTrY0t1DANBgkqhkiG9w0BAQUFADBX
MVUwUwYDVQQDHkwAewA1ADkARgAxAEUANAA2ADEALQBEAEQARQA1AC0ANABEADIA
RgAtAEEAMAAxAEEALQA4ADMAMwAyADIAQQA5AEUAQgA4ADMAOAB9MB4XDTE1MDYx
NTA1NDc1N1oXDTE2MDYxNDExNDc1N1owVzFVMFMGA1UEAx5MAHsANQA5AEYAMQBF
ADQANgAxAC0ARABEAEUANQAtADQARAAyAEYALQBBADAAMQBBAC0AOAAzADMAMgAy
AEEAOQBFAEIAOAAzADgAfTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAk41G
nqXXLaiOC/y0/cA4tbS+NZCqI+x4EsztgDFvPPlHstiVYcLRkni4i93gK9zoC6g0
mh66HMVzAfE8vRNwW5b7m6nWS1SiHBon7/Mqsw4MIq3SC+J/fTbKpqwyfAuH2YZl
AiQuQc85fyllAMLh2WrA7JgOLR/5tF3kLtpbHdECAwEAATANBgkqhkiG9w0BAQUF
AAOBgQArdh+RyT6VxKGsXk1zhHsgwXfToe6GpTF4W8PHI1+T0WIsNForDhvst6nm
QtgAhuZM9rxpOJuNKc+pM29EixpAiZZiRMCSWEItNyEVdUIi+YnKBcAHd88TwO86
d126MWQ2O8cu5W1VoDp7hYBYKOnLbYi11/StO+0rzK+oPYAvIw==
</X509Certificate></X509Data></KeyInfo></Signature></Envelope>

0 comments on commit 92dcf2a

Please sign in to comment.