Skip to content

🧾 A library for signing XML documents using the XADES-BES algorithm, which follows the guidelines of the SRI of Ecuador

License

Notifications You must be signed in to change notification settings

jsonfm/xades-bes-sri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧾⚡️ XADES BES SRI

An implementation of xades bes sri python to sign XML documents for e-invoicing.

⚙️ Technologies

  • lxml
  • cryptography
  • xml

📦 Installation

pip install git+https://github.com/jsonfm/[email protected]

✨ Read .p12 file

from xadessri import get_private_key


with open("/signature.p12", mode="rb") as file:
    p12 = file.read() # bytes


p12 = get_private_key(p12, "password")
print(p12.key)
print(p12.cert)

✨ Sign a XML

from xadessri import sign_xml


with open("/signature.p12", mode="rb") as file:
    p12 = file.read() # bytes


xml = """<xml><data>some important data</data></xml>"""

signed = sign_xml(p12, "password", xml)

print("signed: ", signed)

🔆 Credits

Project Inspired by xades-bes-sri-ec created by @alfredo138923. Thanks.

About

🧾 A library for signing XML documents using the XADES-BES algorithm, which follows the guidelines of the SRI of Ecuador

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages