-
Notifications
You must be signed in to change notification settings - Fork 179
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
Signing elements inside <Signature> #204
Comments
hey! did you get any success with that? |
Hey i am also facing same issue with id attribute _0 in reference tag in XML-signature anyone having how to handle it from java-script side please let me know |
due to In reference tag _0 taking by-default how to handle it that id attribute ...? |
@jmbrito01 , I pretty-printed your XML to make it easier to read. It would also be useful to see what XML you're starting with and what code you're using. Ideally, we'd like to see a PR with a failing test so that once this is fixed we can make sure it never breaks again. Would you or @bermr or @heena-snap be able to provide such a PR? |
Hi, @jmbrito01 or @heena-snap did you succeed in solving this problem? I am having the same problem. |
how did you solve this issue X509IssuerName ? |
how to reference a KeyInfo ? |
i solved by not using the lib |
Are you using another library? Or something else? |
What did you use? Could you please share/guide us? |
i used crypto to create digests and xmlbuilder2 to build and manipulate the doc |
Copy pasting comment from: #486 (comment) Regarding Reference which URI attribute is omitted spec https://www.w3.org/TR/2008/REC-xmldsig-core-20080610/#sec-URI says:
So (IMHO) it seems that at the end of the day one has to construct signature without the help of xml-crypto because at least I can't figure out how xml-crypto would be made aware which part of the document should be handled when reference without URI is added. This second opinion backs aforementioned interpretation: https://stackoverflow.com/questions/15522098/java-xmldsig-reference-with-no-uri/18526152#18526152 Regarding
Solution for that is WIP at
Regarding
Spec says e.g.:
Quick look to xml-crypto codebase did not provide clear answer whether it would use aforementioned node-set (during digest calculation during signing or during digest calculation during validation). Furthermore I did not understand (from the specs) whether node-set is interpreted in this issue's case to be FWIW, based on this #486 (comment) Chilkat had maybe also different opinion (due to unability calculate same digest for reference 2 which has URI='') which node-set (Envelope or AppHdr or Sgntr) it should use in case of empty URI than the program which generated signed document. And reason why Chilkat was unable to calculate same digest for reference which did not have URI at all might be caused by the fact that it isn't aware of which object that reference refers to. Full disclosure: I am not a xmlsig expert. Just had some free time to invest out of curiosity. IMHO #486 should be closed because it is about some java stack related problem even though better issue context extraction process ended up to about same problem as this issue and this #204 should stay open until someone has determined whether URI='' case has some xml-crypto related issue (from signature generation or validation pov) or whether it is validatable only with some custom implementstion which uses even lower level APIs (like someone had already done). FWIW2, South-America region has also other interesting xmlsigning cases like #473 and #115 |
I'm trying to use xml-crypto to sign some ISO-20022 messages following the Brazilian Central Bank pattern, one of the requirements is to create a signature from the x509 KeyInfo.
Is there a way today to use addReference to sign elements inside the Signature element?
I need something like this:
Where URI='' is the signature from the AppHdr without the Signature element, URI='uuid' is the signature from the KeyInfo(A x509 certificate) and ds:Reference is the signature from the Document element.
I was able to do the URI='' but the other two i couldn't do using the documentation.
Is there some way to do this on xml-crypto?
The text was updated successfully, but these errors were encountered: