Edit

Share via


XML Canonicalization

XML canonicalization solves the problem of converting a set of XML nodes into bytes in such a way that trivial changes to the XML (such as changing the order of attributes in an element) do not change the resulting byte form. The bytes obtained from canonicalization are commonly used to generate a cryptographic signature over XML content.

The commonly used XML canonicalization algorithms standardize the following aspects:

  • Character encoding (UTF-8 without preamble)
  • Linefeed and other character forms
  • Attribute order in an element
  • Empty element form
  • Rendering namespace declarations

The APIs WsStartReaderCanonicalization and WsEndReaderCanonicalization provide the XML canonicalization functionality while reading a document.

The APIs WsStartWriterCanonicalization and WsEndWriterCanonicalization provide the XML canonicalization functionality while writing a document.

The following enumerations are used with canonicalization:

The following functions are used with canonicalization:

The following structures are used with canonicalization: