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

[ENHANCEMENT]: AddObject to SignedXml instance

Open imedacf opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe...

I don't think there is a way to addObject to SignedXml instance. Would be nice to add this functionality. Currently missing it myself.

Describe teh solution you'd like...

(new SignedXml()).AddObject(xmlString) would be easy to use this functionality.

Describe the alternatives you've considered...

I don't think there is any other alternative to addobject in signature xml currently.

imedacf avatar Jan 26 '24 20:01 imedacf

Can you please link to the spec?

cjbarth avatar Jan 28 '24 16:01 cjbarth

Have similar functionality in C# and wiling to do same in js. This is C# documentation of generating XML signature and adding the object I am signing inside it:

https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.xml.signedxml.addobject?view=dotnet-plat-ext-8.0

I will try to find official specs on this.

imedacf avatar Jan 28 '24 22:01 imedacf

I will try to find official specs on this.

@imedacf are you looking for the spec at the end of this search path (step 3):

  1. Link from your comment: https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.xml.signedxml.addobject?view=dotnet-plat-ext-8.0
  2. Remarks at that page https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.xml.signedxml.addobject?view=dotnet-plat-ext-8.0#remarks say

    The AddObject method adds an <Object> element that represents an object to be signed to the <Signature> element of an XML digital signature. ... For more information about XML digital signatures, see the XMLDSIG specification.

  3. And from table of contents of XMLDSIG spec: https://www.w3.org/TR/xmldsig-core/#sec-Object

srd90 avatar Feb 17 '24 10:02 srd90

@srd90 , you're always on top of this stuff :) Thanks!

@imedacf , please feel free to put up a PR that aligns with this spec and we'll review it.

cjbarth avatar Feb 17 '24 13:02 cjbarth