Ecosyste.ms: Awesome
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 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
- Host: GitHub
- URL: https://github.com/jsonfm/xades-bes-sri
- Owner: jsonfm
- License: agpl-3.0
- Created: 2024-02-25T04:27:54.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-02-25T15:53:19.000Z (10 months ago)
- Last Synced: 2024-02-26T05:28:13.099Z (10 months ago)
- Topics: bes, ecuador, python, sri, xades, xml
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- 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/[email protected]
```### โจ Read .p12 file
```python
from xadessri import get_private_keywith open("/signature.p12", mode="rb") as file:
p12 = file.read() # bytesp12 = get_private_key(p12, "password")
print(p12.key)
print(p12.cert)
```### โจ Sign a XML
```python
from xadessri import sign_xmlwith open("/signature.p12", mode="rb") as file:
p12 = file.read() # bytesxml = """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.