Share via


Signature.Sign method

Writes the XML digital signature block and computes the cryptographic hash for the signed data.

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

Syntax

'Declaration
Sub Sign
'Usage
Dim instance As Signature

instance.Sign()
void Sign()

Remarks

The Sign method can only be called from the OnSign event. Calling this method advances the Digital Signatures Wizard to the second step in the signing process, selecting a certificate.

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

Signature interface

Signature members

Microsoft.Office.Interop.InfoPath namespace