An open API service indexing awesome lists of open source software.

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

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.