For the Spanish version, see README.es.md.
Validates XAdES-EPES digital signatures in XML documents, ideal for electronic invoices and other digitally signed documents.
- Validates XAdES-EPES signatures in XML files.
- Detects any modifications in the signed XML.
- Can be used as a Python script or standalone executable.
- Python 3.8 or higher
- Python libraries:
lxmlcryptographypyopensslxmlsecxades
Install the necessary dependencies by running:
pip install lxml cryptography pyopenssl xmlsec xadespython validar_xades.py /path/to/signed_file.xmlvalidar_xades.exe /path/to/signed_file.xmlThe script returns:
Trueif the signature is validFalseif the signature is NOT valid
This allows detecting if the XML has been modified: any alteration will make the signature invalid.
You can generate an executable with PyInstaller. Example command (adjust the path to your Python environment):
python -m PyInstaller \
--add-data ".../Python313/site-packages/xades/data;xades/data" \
--add-data ".../Python313/site-packages/xmlsig/data;xmlsig/data" \
validar_xades.pyThis will create the executable in the dist/ folder.
- If you have issues with dependencies, check that
xmlsecandpyopensslare correctly installed and configured on your system. - The script is designed to be simple and portable.
Andrey Rodriguez Araya