xmlsec
Python bindings for the XML Security Library
What it is and what it does
xmlsec is a Python wrapper around the XML Security Library, a C library for cryptographic operations on XML documents. It lets you sign XML documents with digital certificates, verify signatures, and perform related cryptographic tasks. The package depends on lxml and requires system-level installation of libxml2 and libxmlsec1 before use.
The library is production-stable and actively maintained. It supports Python 3.9 through 3.14 and provides prebuilt wheels for most common platforms, though building from source on less common architectures may require manual compilation. Use it when you need to add XML signature or verification capabilities to applications handling XML-based security protocols.
Use it for:
- Sign and verify XML documents in enterprise messaging systems
- Validate digitally signed XML in protocol implementations
- Implement XML encryption and decryption for sensitive data transport
- Verify XML signatures in web service communications
- Build systems requiring cryptographic proof of XML document authenticity
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python bindings for XML Security Library, enabling cryptographic signing and verification of XML documents.
Yes, if you need XML cryptographic operations. The package is production-stable, actively maintained, and has no known vulnerabilities. Install friction is moderate due to native library dependencies, but prebuilt wheels for common platforms ease deployment. Permissive MIT license poses no legal friction. Verify that libxml2 >= 2.9.1 and libxmlsec1 >= 1.2.33 are available on your target systems before committing.
Install
xmlsec on PyPI
pip
pip install xmlsecuv
uv add xmlsecpoetry
poetry add xmlsecInstalling xmlsec
Before you install
Medium install friction due to compiled C extension requiring native libraries (libxml2 >= 2.9.1, libxmlsec1 >= 1.2.33). Prebuilt wheels available for Python 3.9–3.14 on macOS, Linux, and Windows reduce friction on common platforms. Repository is active with recent commits.
License in practice
MIT license permits commercial and private use with minimal restrictions; no copyleft obligations or patent concerns.
Quickstart
pip install xmlsec
import xmlsec
# See xmlsec.readthedocs.io/en/latest/examples.html for signing and verification examples
Requires libxml2 >= 2.9.1 and libxmlsec1 >= 1.2.33 installed on the system before pip install
Verify before relying
- Whether prebuilt wheels cover all target deployment architectures (riscv64 wheels present but platform adoption unclear)
- Performance characteristics for large-scale XML document signing or verification workflows
- Compatibility with specific XML Security Library versions beyond the stated minimum
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — lxml |
| Maintenance | actively maintained — 276 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,978,017/month — #1,350 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: xmlsec-1.3.17-cp310-cp310-macosx_10_9_x86_64.whl; xmlsec-1.3.17-cp310-cp310-macosx_11_0_arm64.whl; xmlsec-1.3.17-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; xmlsec-1.3.17-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl; xmlsec-1.3.17-cp310-cp310-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl; xmlsec-1.3.17-cp310-cp310-musllinux_1_2_aarch64.whl; xmlsec-1.3.17-cp310-cp310-musllinux_1_2_x86_64.whl; xmlsec-1.3.17-cp310-cp310-win_amd64.whl; xmlsec-1.3.17-cp310-cp310-win_arm64.whl; xmlsec-1.3.17-cp311-cp311-macosx_10_9_x86_64.whl; xmlsec-1.3.17-cp311-cp311-macosx_11_0_arm64.whl; xmlsec-1.3.17-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; xmlsec-1.3.17-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl; xmlsec-1.3.17-cp311-cp311-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl; xmlsec-1.3.17-cp311-cp311-musllinux_1_2_aarch64.whl; xmlsec-1.3.17-cp311-cp311-musllinux_1_2_x86_64.whl; xmlsec-1.3.17-cp311-cp311-win_amd64.whl; xmlsec-1.3.17-cp311-cp311-win_arm64.whl; xmlsec-1.3.17-cp312-cp312-macosx_10_13_x86_64.whl; xmlsec-1.3.17-cp312-cp312-macosx_11_0_arm64.whl
Keywords: xmlsec
Tags
More XML packages
Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
lxmllxml provides Python bindings to libxml2 and…
permissive · top 1,000 on PyPI
defusedxmlDefusedxml hardens Python's standard XML…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
xmltodictConverts XML to Python dictionaries and back,…
permissive · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
endesiveEndesive signs and verifies digital signatures…
unclear · top 15,000 on PyPI
securesystemslibSecuresystemslib provides a cryptography…
permissive · top 5,000 on PyPI
signxmlSignXML implements W3C XML Signature (XMLDSig)…
permissive · top 5,000 on PyPI
pysaml2PySAML2 is a pure Python implementation of SAML…
unclear · top 5,000 on PyPI
python3-samlTurns a Python application into a SAML 2.0…
permissive · top 5,000 on PyPI
python-gnupgProvides Python bindings to GnuPG for key…
permissive · top 5,000 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
standardwebhooksProvides webhook payload verification and…
permissive · top 5,000 on PyPI