0

I have a need to incorporate some kind of integrity check of XML file into it's structure. Considering an XmlDSig as a standard, I wonder is there any way to get rid of asymmetric key (authentication) feature? Or maybe there is some other standard for the sole purpose of XML file integrity validation?

SHA1 is a hash function and doesn't require any key to be generated. It's enough for integrity check, on it's own. It's evident that generation of a temporary assymetric key for the sole integrity check purpose is an excessive operation. Using C# there are some pitfalls also exists.

If key is not assigned to SignedXml.SignedKey property, SignedXml.ComputeSignature method cause 'Signing key is not loaded' exception.

Community
  • 1
  • 1
frtnum
  • 177
  • 14
  • If you have a schema then you can validate. – John Saunders Jan 30 '13 at 12:57
  • Schema validate only structure of XML document. Schema successfully validates the following two XML documents: (1) and (2) , but these documents have different SHA1 hash values. The problem arises when you have to write, for instance, method of hash code retrieval (MD5, SHA1 etc.) and canonicalization method. Then you need some kind of a standard, which XmlDSig obviously is. But XmlDSig provide 2 functions - integrity & authentication. And I have a need in only one of them. – frtnum Jan 30 '13 at 13:13
  • So you need protection against deliberate data manipulation? – John Saunders Jan 30 '13 at 14:25
  • Not against deliberate manipulation, but against accidental changes. For example, when process killed or power outage happens during the process of XML file saving. As file write operation is not necessary sequential, it's very little probability, but it still possible, that in case of such kind of event the structure of XML file could be valid, but content is invalid. – frtnum Jan 31 '13 at 08:25

0 Answers0