SignEventObject interface
An event object that is used during the OnSignevent.
Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)
Syntax
'Declaration
<GuidAttribute("096CD71D-0786-11D1-95FA-0080C78EE3BB")> _
Public Interface SignEventObject _
Inherits SignEvent
'Usage
Dim instance As SignEventObject
[GuidAttribute("096CD71D-0786-11D1-95FA-0080C78EE3BB")]
public interface SignEventObject : SignEvent
Remarks
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.
Examples
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();
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;
}