Skip to content

Add XmlDSigVerifier wrapper for SignedXml#519

Open
shunkica wants to merge 19 commits into
node-saml:masterfrom
shunkica:signer-validator-separation
Open

Add XmlDSigVerifier wrapper for SignedXml#519
shunkica wants to merge 19 commits into
node-saml:masterfrom
shunkica:signer-validator-separation

Conversation

@shunkica
Copy link
Copy Markdown
Contributor

@shunkica shunkica commented Oct 25, 2025

As per the discussion #517 I set out to do some work on this problematic.

My conclusion was that it would be best to not just separate the reference types, but separate the signer from the validator entirely, while providing a more streamlined interface.

I am submitting this initial draft for your review and opinions.

The goal was to not introduce any breaking change, instead produce these wrappers so users can slowly start migrating toward them. The next step would be to deprecate SignedXml, migrate the specific signature/validation functions in their respective class, with the final breaking change being to remove SignedXml entirely.

The tests are currently just AI slop. I welcome anyone that wants to contribute.

Once the XmlDSigSigner and XmlDSigValidator are configured, they can be reused to sign/validate multiple xml files, since each time sign/compute is called a new SignedXml instance is created internally.

Summary by CodeRabbit

  • New Features

    • Added XmlDSigVerifier with strict and deferred-trust flows, reusable/static verify APIs, and extracted-certificate support.
    • Exposed centralized XMLDSIG URI constants and additional algorithm/transform/hash/signature/enveloped-signature exports.
  • Configuration / Types

    • Richer, URI-based configuration: typed algorithm URIs, namespaced idAttributes, idAttributes array, maxTransforms, and algorithm allow-lists.
  • Utilities

    • parseXml helper and stricter namespace-aware attribute/child lookup behavior.
  • Documentation

    • New XmlDSigVerifier guide and README section.
  • Tests

    • Expanded verifier, utils, canonicalization, and algorithm test coverage.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants