xml-crypto icon indicating copy to clipboard operation
xml-crypto copied to clipboard

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

Open lukehorvat opened this issue 10 years ago • 4 comments

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.)

lukehorvat avatar Jun 24 '14 13:06 lukehorvat

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

yaronn avatar Jun 24 '14 17:06 yaronn

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

lukehorvat avatar Jun 26 '14 05:06 lukehorvat

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 [email protected] 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 https://github.com/yaronn/xml-crypto/issues/33#issuecomment-47190354.

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

yaronn avatar Jun 26 '14 09:06 yaronn

@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?

cjbarth avatar May 29 '23 21:05 cjbarth