error due to xml signature

2019-07-03 03:52发布

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?

2条回答
该账号已被封号
2楼-- · 2019-07-03 04:24

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.

查看更多
3楼-- · 2019-07-03 04:40

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.

查看更多
登录 后发表回答