This project is read-only.

XAdES .NET Project Documentation

XMLDSIG Sign

As in any XMLDSIG operation, XAdES .NET Project provides only one entry point: the Utility Class XadesNetLib.XmlDsig.XmlDsigHelper.

This class contains a list of methods that allows the navigation through the fluent interfaces programmed in the library.

To create a new signature, the user can use four methods of XmlDsigHelper:
  • XmlDsigHelper.Sign(string inputPath). Allows the user to sign a file using only its path.
  • XmlDsigHelper.Sign(XmlDocument xmlDocument). Allows the user to sign a XmlDocument, so the input does not have to be written in a file (can be created at runtime in memory).
  • XmlDsigHelper.BatchSign(params string[] inputPaths). Provides the user with a method to sign several files at once. Note: This method will produce as many output files -or XmlDocuments- as input files are specified)
  • XmlDsigHelper.BatchSign(params XmlDocument[] xmlDocuments). Provides the user with a method to sign several XmlDocument objects at once. Note: This method will produce as many output files -or XmlDocuments- as input files are specified)

Examples:
  • Single signature to a file:
	// ... Previous code

	// Signs input.xml and produces output.xml file
	var myCertificate = ReadMyCertificate(); // ... a certificate is needed to sign, put here the code to access it
	XmlDsigHelper.Sign("input.xml").Using(myCertificate).SignToFile("output.xml");
	
	// ... and the method continues


Follows up:

Last edited Nov 23, 2010 at 8:11 AM by lvillap, version 3

Comments

No comments yet.