Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SignEvent Object

Office 2007
An event object that is used during the OnSign event.

Version Information
 Version Added:  InfoPath 2003


Use the SignedDataBlock property of the SignEventObject object to determine which signed data block is triggering the OnSign event. The OnSign event is raised for a fully trusted form template only.


In the following example, the SignEvent object is used to add a signature and timestamp to a SignedDataBlock object:

public void OnSign(SignEvent e)
    Signature signature = e.SignedDataBlock.Signatures.Create();

	   // Countersign the signature with a trusted timestamp.

	   // Get the XML node storing the signature block.
	   IXMLDOMNode oNodeSig = signature.SignatureBlockXmlNode;
	   IXMLDOMNode oNodeSigValue = oNodeSig.selectSingleNode(".//*[local-name(.)=’signatureValue’]");
	   // Get time stamp from timestamp service (fictitious).
	   MyTrustedTimeStampingService s = new MyTrustedTimeStampingService();
	   string strVerifiedTimeStamp = s.AddTimeStamp(oNodeSigValue.text);
	   //Add the value returned from the timestamping service to the 
	   //unsigned part of the signature block.
   	IXMLDOMNode oNodeObj = oNodeSig.selectSingleNode(".//*[local-name(.)=’Object’]");
	   IXMLDOMNode oNode = oNodeObj.cloneNode(false);
	   oNode.text = strVerifiedTimeStamp;

	   e.ReturnStatus = true;

Community Additions

© 2015 Microsoft