error due to xml signature

柔情痞子 提交于 2019-12-23 19:03:46

问题


I have an xml document. When I print the document using java libs I get the proper xml output. Then I sign the xml document using xmlsignatures. After signing, I try to print the document again. But this time the document is printed in such a way that all the Elements are JUMBLED . So I want to know whether xml signature modifies xml document? If yes then why?


回答1:


Signature may modify your structure by canonicalizing it. This is necessary because your xml can have different valid representations. In order to verify the signature all parties must agree on one canonicalized representation.




回答2:


Like @Mat, I would like to have more details about what you mean by JUMBLED. Nonetheless, your original document should not be altered in its structure if you have chosen the ENVELOPED (or obviously DETACHED) signature method. Conversely, choosing an ENVELOPING method does change your original document by wrapping it in a container that also includes the signature.



来源:https://stackoverflow.com/questions/10152350/error-due-to-xml-signature

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!