Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT]: AddObject to SignedXml instance #446

Open
imedacf opened this issue Jan 26, 2024 · 4 comments
Open

[ENHANCEMENT]: AddObject to SignedXml instance #446

imedacf opened this issue Jan 26, 2024 · 4 comments

Comments

@imedacf
Copy link

imedacf commented Jan 26, 2024

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.

@cjbarth
Copy link
Contributor

cjbarth commented Jan 28, 2024

Can you please link to the spec?

@imedacf
Copy link
Author

imedacf commented Jan 28, 2024

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.

@srd90
Copy link

srd90 commented Feb 17, 2024

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

@cjbarth
Copy link
Contributor

cjbarth commented Feb 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants