skillfed

signxml

Python XML Signature and XAdES library

signxml v5.1.0 3.2M downloads/30d#2,707 on PyPI154
Permissive license Apache Software License Active released

What it is and what it does

SignXML is a Python implementation of the W3C XML Signature standard, used to cryptographically sign and verify XML documents in enterprise protocols like SAML 2.0, XAdES, EBICS, and WS-Security. It wraps lxml and cryptography to provide both standard XMLDSig operations and extensions for X.509 certificate chain validation, hostname/CN verification, and XAdES support.

The library is designed with security-first defaults: it uses a libxml2-based parser hardened against common XML attacks, disables network calls and unsafe transforms by default, and emphasizes the "see what is signed" principle to prevent signature-wrapping attacks. It supports exclusive XML canonicalization with inclusive prefixes, certificate validity checks at a specific point in time, and flexible trust establishment via pre-shared certificates, CA files, or subject name matching.

Use it for:

  • Verify SAML 2.0 assertions from identity providers by extracting and validating X.509 certificates from SAML metadata.
  • Sign and verify XAdES digital signatures for long-term archival and legal compliance in document workflows.
  • Validate XML signatures in EBICS banking protocols to ensure message authenticity and non-repudiation.
  • Establish trust in XML-based web services by verifying WS-Security signatures with certificate chain validation.
  • Prevent SAML signature-wrapping attacks by configuring expected signature location and verifying only the returned signed_xml data.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

SignXML implements W3C XML Signature (XMLDSig) standard for signing and verifying XML documents, with support for SAML 2.0, XAdES, EBICS, and WS-Security protocols.

Yes. SignXML is actively maintained, has no known vulnerabilities, low install friction, and implements a critical security standard for enterprise XML protocols. It is appropriate for production use in SAML, XAdES, EBICS, and WS-Security integrations where XML signature verification is required.

Install

signxml on PyPI

pip

pip install signxml

uv

uv add signxml

poetry

poetry add signxml

Installing signxml

Before you install

Low friction: pure Python wheel with three stable, widely-used dependencies (lxml, cryptography, certifi). Active maintenance with a release 40 days ago and continuous integration.

License in practice

Apache Software License (permissive): you can use, modify, and distribute signxml freely in commercial and private projects, with minimal restrictions beyond attribution.

Quickstart

from lxml import etree
from signxml import XMLSigner, XMLVerifier

root = etree.fromstring(data_to_sign)
signed_root = XMLSigner().sign(root, key=key, cert=cert)
verified_data = XMLVerifier().verify(signed_root).signed_xml

Requires lxml (libxml2-based XML parser) and valid X.509 certificate/key pair in PEM format; openssl needed to generate test certificates.

Verify before relying

  • Whether XPath and XSLT transform support is available or intentionally excluded for security
  • Specific XAdES profile coverage beyond the excerpt's mention of XAdES support

Package facts

License Apache Software License (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — certifi, cryptography, lxml
Maintenance actively maintained — 40 days since the last release
Last repo commit
First released
Downloads 3,188,123/month — #2,707 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: signxml-5.1.0-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIXProgramming Language :: PythonProgramming 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 :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python Modules

Tags

xml signature verificationxmldsig implementationsaml assertion signingxades digital signaturesxml payload securitycertificate chain validation xmlxml canonicalization
xml-securitysamldigital-signatures

More Software Development packages