skillfed

xmlsec

Python bindings for the XML Security Library

xmlsec v1.3.17 12.0M downloads/30d#1,350 on PyPI105
Permissive license MIT Active released

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 xmlsec

uv

uv add xmlsec

poetry

poetry add xmlsec

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: CProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Text Processing :: Markup :: XMLTyping :: Typed

Tags

xml signing verificationxmlsec python bindingsdigital signatures xmlxml security librarycryptographic xml operationsxml encryption decryptionxml document authentication
xml-securitycryptography

More XML packages