SignEventObject interface

Office 2013 and later

An event object that is used during the OnSign event.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

public interface SignEventObject : SignEvent, 
	DocReturnEvent, DocEvent

This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, seeSignEvent.

Use the SignedDataBlock property of the SignedDataBlockObject object to determine which set of data, which can be signed, is triggering the OnSign event. The OnSign event can be customized for a fully trusted form template only.

In the following example, the SignEvent object is used to add a signature and timestamp to a SignedDataBlockObject 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;