You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
changed the title [-]How to create enveloped signature and sign the whole document i.e. have `URI=""`[/-][+]Enveloped signature and sign the whole document i.e. have `URI=""`[/+]on Nov 7, 2022
changed the title [-]Enveloped signature and sign the whole document i.e. have `URI=""`[/-][+]addReference with empty URI i.e. `URI=""`[/+]on Nov 7, 2022
Suggestion: The 4th argument in addReference method takes uri as input and if the argument's value is passed as "" it should automatically set isEmptyUri to be true. That would make the functionality easier to achieve with a cleaner code.
If you agree, I would be happy to implement it.
Also, It would be nice to add this to the documentation.
Signing the XML document with reference URI="" is one of the most basic requirements. And the library supports it, it would be really nice to add it to the README. Willing to take the documentation task as well
When I try isEmptyUri = false I can verify my signature and it is all good but,
When try isEmptyUri = true I get the bellow error when verifying the signature
VERIFY ERROR:
'invalid signature: for uri calculated digest is 4jyM3Mma3Wo1zTUT8njmv9wHWVnsf2cz4bAS2POf6Do= but the xml to validate supplies digest cJ1B4QVSGSggHteZGcwznrpo5aZy+3L+tK3ZF9PXwj8='
The verification failure reported in #268 (comment) was most likely fixed by #581, released in 6.2.0. When enveloped-signature was the only transform, the signer hashed xmldom's serialization while the verifier canonicalized, so their digests differed for any document whose serialization wasn't already canonical. With 6.3.2, signing with isEmptyUri: true and then verifying passes.
If you still see this on 6.3.2 or later, please comment here with a reproduction and we'll reopen.
Activity
[-]How to create enveloped signature and sign the whole document i.e. have `URI=""`[/-][+]Enveloped signature and sign the whole document i.e. have `URI=""`[/+][-]Enveloped signature and sign the whole document i.e. have `URI=""`[/-][+]addReference with empty URI i.e. `URI=""`[/+]jaikathuria commentedon Nov 7, 2022
Went through the code and was able to find the way to sign the document and add the reference with
URI=""The
addReferencemethod takes the 7th argument asisEmptyUriand when it's value is true the URI is saved as""which was the desired output.It can be achieve something like
jaikathuria commentedon Nov 7, 2022
@LoneRifle Probably you can help here.
Suggestion: The 4th argument in
addReferencemethod takesurias input and if the argument's value is passed as""it should automatically setisEmptyUrito betrue. That would make the functionality easier to achieve with a cleaner code.If you agree, I would be happy to implement it.
Also, It would be nice to add this to the documentation.
Signing the XML document with reference
URI=""is one of the most basic requirements. And the library supports it, it would be really nice to add it to the README. Willing to take the documentation task as wellRodrigobanselmo commentedon Nov 11, 2022
I'm having issues when using isEmptyUri=true.
When I try isEmptyUri = false I can verify my signature and it is all good but,
When try isEmptyUri = true I get the bellow error when verifying the signature
VERIFY ERROR:
'invalid signature: for uri calculated digest is 4jyM3Mma3Wo1zTUT8njmv9wHWVnsf2cz4bAS2POf6Do= but the xml to validate supplies digest cJ1B4QVSGSggHteZGcwznrpo5aZy+3L+tK3ZF9PXwj8='
@jaikathuria are you having the same issue?
jaikathuria commentedon Nov 13, 2022
Not actually. I had to sign the XML to be verified by an external library and I was only able to validate it with
isEmptyUri=true.I didn't try to verify the XML myself though.
How you are trying to sign and verify, I might be able to assist.
cjbarth commentedon May 29, 2023
Feel free to put up a PR that includes some better documentation about this or that improves the user experience.
cjbarth commentedon Sep 24, 2026
isEmptyUri: trueis how to getURI="":The verification failure reported in #268 (comment) was most likely fixed by #581, released in 6.2.0. When
enveloped-signaturewas the only transform, the signer hashed xmldom's serialization while the verifier canonicalized, so their digests differed for any document whose serialization wasn't already canonical. With 6.3.2, signing withisEmptyUri: trueand then verifying passes.If you still see this on 6.3.2 or later, please comment here with a reproduction and we'll reopen.