Skip to content

Use this.idAttributes[0] when setting id attribute of element? #33

Description

@lukehorvat

I noticed here that the id attribute for elements is set. Can we change the hard-coded "Id" to this.idAttributes[0]? That way if one passes in idAttribute as an option to the SignedXml constructor, it will use that instead.

Basically, I'd like to be able to control whether "Id" or "ID" is outputted when I call SignedXml.computeSignature().

(I'm not familiar with xml-crypto, so my apologies if there's a good reason why it's not this way already.)

Activity

  1. yaronn commented on Jun 24, 2014

    @yaronn
    Contributor

    actually the code you referenced to is relevant mainly for parsing incoming attributed. For generation currently Id (or wsu:Id) will be used but you can override it withint the library code here: https://github.com/yaronn/xml-crypto/blob/master/lib/signed-xml.js#L483

  2. lukehorvat commented on Jun 26, 2014

    @lukehorvat
    Author

    That's the same line I linked to...? How to override, when "Id" is hard-coded?

  3. yaronn commented on Jun 26, 2014

    @yaronn
    Contributor

    Right now there is no way to override it but you can change the Id in the
    xml-crypto code for temporary solution

    On Thu, Jun 26, 2014 at 8:57 AM, Luke Horvat notifications@github.com
    wrote:

    That's the same line I linked to...? How to override, when "Id" is
    hard-coded?

    —
    Reply to this email directly or view it on GitHub
    #33 (comment).

    I'm on Twitter (@YaronNaveh http://twitter.com/#!/YaronNaveh)

  4. cjbarth commented on May 29, 2023

    @cjbarth
    Contributor

    @bjrmatos @yaronn , instead of hard-coding something and maintaining a fork, would you consider creating a PR with a test suite so that the community can benefit?

  5. added a commit that references this issue on Jul 12, 2025
    3510993
  6. cjbarth commented on Oct 24, 2025

    @cjbarth
    Contributor

    If you'd like to pursue this again, please reopen this.

  7. added this to the v7.0 milestone on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions