_XDocumentEventSink2_Event.OnSign Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs after a set of signed data has been selected to sign through the Digital Signature wizard.
public:
event Microsoft::Office::Interop::InfoPath::SemiTrust::_XDocumentEventSink2_OnSignEventHandler ^ OnSign;
event Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_OnSignEventHandler OnSign;
member this.OnSign : Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_OnSignEventHandler
Event OnSign As _XDocumentEventSink2_OnSignEventHandler
Event Type
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 <span class="label">OnSign</span>(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;
}
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 <span class="label">OnSign</span>(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;
}
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.