https://github.com/jsonfm/xades-bes-sri
🧾 A library for signing XML documents using the XADES-BES algorithm, which follows the guidelines of the SRI of Ecuador
https://github.com/jsonfm/xades-bes-sri
bes ecuador facturacion-electronica python sri xades xml
Last synced: over 1 year ago
JSON representation
🧾 A library for signing XML documents using the XADES-BES algorithm, which follows the guidelines of the SRI of Ecuador
- Host: GitHub
- URL: https://github.com/jsonfm/xades-bes-sri
- Owner: jsonfm
- License: agpl-3.0
- Created: 2024-02-25T04:27:54.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-25T15:53:19.000Z (over 2 years ago)
- Last Synced: 2025-01-30T12:30:11.817Z (over 1 year ago)
- Topics: bes, ecuador, facturacion-electronica, python, sri, xades, xml
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 🧾⚡️ 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/xades-bes-sri@0.1.0
```
### ✨ Read .p12 file
```python
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
```python
from xadessri import sign_xml
with open("/signature.p12", mode="rb") as file:
p12 = file.read() # bytes
xml = """some important data"""
signed = sign_xml(p12, "password", xml)
print("signed: ", signed)
```
### 🔆 Credits
Project Inspired by [`xades-bes-sri-ec`](https://github.com/alfredo138923/xades-bes-sri-ec.git) created by [@alfredo138923](https://github.com/alfredo138923). Thanks.