Receiving and sign a xml file is implemented and dont denote any error.

Receiving and sign a txt file is implemented but when validation denote errors, i suppose that´s because the "newlines" in txt.
When receive a TXT file, i create a TElXMLDomDocument and the following structure:

Code

<root><ficheiroTXT>"data from inside the txt file"</ficheiroTXT></root>

Yes.
If you uncheck "normalize newline characters on load" in demo application, then the reference and signature will be validated ok.
The best solution, is to remove CR character from text ( st.ReadToEnd().Replace("\r\n", "\n") ), because older xml frameworks convert all linefeed to LF and then check a signature and another frameworks could keep an original linefeed. If the xml document will be used by your application only, then you can simply ignore normalization. Also, you can save xml document in canonical form, so CR character would be saved as & #x0D; entity.

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.