signing a xml document with x509 certificate

后端 未结 2 700
甜味超标
甜味超标 2021-01-02 04:46

Every time I try to send a signed XML, the web service verifier rejects it.

To sign the document I just adapted this sample code provided by Microsoft:

http:

2条回答
  •  没有蜡笔的小新
    2021-01-02 05:14

    It's a long time since this post has been created. I got the same problem with the digital signature can not be validated.

    For whom who has the same issue. In my case the difference is XmlDocument.PreserveWhitespace option.

    When the PreserveWhitespace = true, the document is not valid when checking against the public key. PreserveWhitespace = false makes the signed XML valid.

    I guess that when saving the signed XML to file and sending it to server. There is some space or special characters are inserted to the document and make it invalid.

提交回复
热议问题