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

Remarks

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.

Example

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

JScript
[InfoPathEventHandler(EventType=InfoPathEventType.OnSign)]
public void OnSign(SignEvent e)
{
    Signature signature = e.SignedDataBlock.Signatures.Create();
	   signature.Sign();

	   // 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;
	   oNodeObj.parentNode.appendChild(oNode);

	   e.ReturnStatus = true;
}



Community Additions

ADD
Show:
© 2014 Microsoft