_XDocumentEventSink2_Event.OnSign event
Occurs after a set of signed data has been selected to sign through the Digital Signature wizard.
Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)
Syntax
'Declaration
Event OnSign As _XDocumentEventSink2_OnSignEventHandler
'Usage
Dim instance As _XDocumentEventSink2_Event
Dim handler As _XDocumentEventSink2_OnSignEventHandler
AddHandler instance.OnSign, handler
event _XDocumentEventSink2_OnSignEventHandler OnSign
Remarks
You can use the OnSign event to add additional data to the digital signature. For example, you can add data from a trusted timestamp server, or add a server-side countersignature of the transaction. You can also use the OnSign event to block signing if the current user is not a member of a particular group.
Examples
In the following example, created by adding the OnSign event to the form by selecting Programming from the Tools menu in the InfoPath designer user interface, a digital signature is added to the form by using the Sign method of the SignatureObject object:
public void OnSign(SignEvent e)
{
// The OnSign handler can be customized only in fully trusted form templates.
Signature thisSignature = e.SignedDataBlock.Signatures.Create();
// You can add other pieces of information to sign by modifying the signature
// template in thisSignature.SignatureBlockXmlNode.
thisSignature.Sign();
e.ReturnStatus = true;
}
See also
Reference
_XDocumentEventSink2_Event interface