Export (0) Print
Expand All

SignEventObject Interface

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)

[GuidAttribute("096cd71d-0786-11d1-95fa-0080c78ee3bb")]
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:

[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