The .NET Framework supports the XML Signature specification (commonly referred to as XMLDSIG), which provides a standard approach to creating and representing signatures for XML documents.
In this section, we introduce the .NET XMLDSIG classes. We do not discuss all of the options available to you or provide in-depth coverage of the standard itself. The XMLDSIG standard is complex, and full coverage is outside the scope of this book. For full details of the XML Signature specification, consult the World Wide Web Consortium web site, at http://www.w3.org/TR/xmldsig-core. Consult the .NET documentation for full details of the XMLDSIG classes. You should have a basic understanding of how the .NET Framework supports XML.
The .NET Framework includes classes that support creating and verifying XMLDSIG signatures for XML documents; in other words, the .NET XMLDSIG classes allow you to sign XML documents to create signatures that are also XML documents themselves.
Throughout this section, we will base our examples on creating a signature for the following simple XML, which we assume is in a file named book.xml:
<book> <title>Programming .NET Security</title> <author>Adam Freeman</author> <author>Allen Jones</author> </book>
All of the .NET XMLDSIG classes are contained in the
System.Security.Cryptography.Xml namespace, which
is included in System.Security.dll.
In the following sections, we demonstrate how to create an XMLDSIG ...