Skip to main content

SUNAT - sign and verify xml

Project description

SignXML Sunat is an implementation of the W3C XML Signature standard in Python. SignXML Sunat implements all of the required components of the standard, and most recommended ones. Its features are:

  • Well-supported, portable, reliable dependencies: lxml, xmlsec
  • Simple interface with useful defaults
  • Compactness, readability, and extensibility


pip install signxml_sunat

Note: SignXML SUNAT depends on lxml and xmlsec

OS Python Command
Ubuntu 16.04, 18.04 Python 3 pip install lxml xmlsec

Note: In windows you need install a binary for lxml and xmlsec


SignXML SUNAT uses the ElementTree API (also supported by lxml) to work with XML data.

from signxml_sunat import XMLSigner, XMLVerifier

signed_root = XMLSigner().sign('doc.xml', key_data='rsakey.pem', cert_data='rsacert.pem')
# if you need password
# signed_root = XMLSigner().sign('doc.xml', key_data='rsakey.pem', cert_data='rsacert.pem', password='p4ssw0rd')
verified = XMLVerifier().verify('signed_doc.xml', key_data='rsakey.pem')
# if you need password
# verified_data = XMLVerifier().verify('signed_doc.xml', key_data='rsakey.pem', password='p4ssw0rd')


  • Danilo Britto Nuñez


Please report bugs, issues, feature requests, etc. on GitHub.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for signxml_sunat, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size signxml_sunat-1.0.3.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page