System.Security.Cryptography.Xml.XmlDsigExcC14NWithCommentsTransform Class

Represents the exclusive C14N XML canonicalization transform for a digital signature as defined by the World Wide Web Consortium (W3C), with comments.

See Also: XmlDsigExcC14NWithCommentsTransform Members


public class XmlDsigExcC14NWithCommentsTransform : XmlDsigExcC14NTransform


The System.Security.Cryptography.Xml.XmlDsigExcC14NWithCommentsTransform class represents the exclusive C14N XML canonicalization transform with comments. This class is similar to the System.Security.Cryptography.Xml.XmlDsigExcC14NTransform class, which allows a signer to create a digest using the canonical form of an XML document. However, the System.Security.Cryptography.Xml.XmlDsigExcC14NWithCommentsTransform class excludes ancestor context from a canonicalized subdocument.

Use the System.Security.Cryptography.Xml.XmlDsigExcC14NWithCommentsTransform class when you need to canonicalize an XML subdocument so that it is independent from its XML context. For example, applications such as Web services that use signed XML within complex communication protocols often need to canonicalize XML in this manner. Such applications often envelop XML within various dynamically constructed elements, which can substantially change the document and cause XML signature verification to fail. The System.Security.Cryptography.Xml.XmlDsigExcC14NWithCommentsTransform class solves this problem by excluding such ancestor context from the canonical subdocument.

Note that you cannot directly create a new instance of a canonicalization transform class. To specify a canonicalization transform, pass the Uniform Resource Identifier (URI) that describes the transform to the SignedInfo.CanonicalizationMethod property, which is accessible from the SignedXml.SignedInfo property. To acquire a reference to the canonicalization transform, use the SignedInfo.CanonicalizationMethodObject property, which is accessible from the SignedXml.SignedInfo property.

The URI that describes the System.Security.Cryptography.Xml.XmlDsigExcC14NWithCommentsTransform class is defined by the SignedXml.XmlDsigExcC14NWithCommentsTransformUrl field.

For more information about the exclusive C14N transform, see the XMLDSIG specification, which is available from the World Wide Web Consortium (W3C) at The canonicalization algorithm is defined in the W3C Canonical XML specification, which is available at


Namespace: System.Security.Cryptography.Xml
Assembly: System.Security (in System.Security.dll)
Assembly Versions:,
Since: .NET 2.0