Düzenle

Aracılığıyla paylaş


Signature.Sign Method

Definition

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

public:
 void Sign();
public void Sign ();
abstract member Sign : unit -> unit
Public Sub Sign ()

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.<span class="label">Sign</span>();
e.ReturnStatus = true;
}

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.

Applies to