Skip to content

Instantly share code, notes, and snippets.

@alcidesrivera
Created July 6, 2015 03:58
Show Gist options
  • Save alcidesrivera/c11a06de3bc0af1249ee to your computer and use it in GitHub Desktop.
Save alcidesrivera/c11a06de3bc0af1249ee to your computer and use it in GitHub Desktop.
Firmado XML
factura = self._generate_xml_invoice(obj, access_key, emission_code)
xades = Xades()
file_pk12 = obj.company_id.electronic_signature
password = obj.company_id.password_electronic_signature
xmlstr = etree.tostring(factura, encoding='utf8', method='xml')
p = Popen([JAVA_CMD, '-jar', JAR_PATH, xmlstr, file_pk12, password], stdout=PIPE, stderr=STDOUT)
resultado = p.communicate()[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment