Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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 python sri xades xml

Last synced: 19 days 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/[email protected]
```

### โœจ 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.