Export (0) Print
Expand All

Signature.Status property

Gets the status of the specified digital signature.

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

XdSignatureStatus Status { get; }

The status that is returned is based on the XdSignatureStatus enumeration.

The Status property only verifies whether the hash of the digital signature is valid. It does not verify the chain of trust of the digital certificate, nor does it verify that the image of the view captured at the time the signature was added matches the current view of the signed form.

Important noteImportant

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

In the following example, the Status property of the Signature object is used to determine the status of the signature, and is displayed in a message box:

public void DisplaySignatureProperties()
{
SignatureObject mySignature = thisXDocument.SignedDataBlocks[0].Signatures[0];
string signatureStatus = "Unknown";
switch(mySignature.Status)
{
 case XdSignatureStatus.xdSignatureStatusValid : 
  signatureStatus = "Valid";
  break;
 case XdSignatureStatus.xdSignatureStatusInvalid : 
  signatureStatus = "Invalid";
  break;
 case XdSignatureStatus.xdSignatureStatusError :
  signatureStatus = "Error";
  break;
 case XdSignatureStatus.xdSignatureStatusUnsupported :
  signatureStatus = "Unsupported";
  break;
}
thisXDocument.UI.Alert("Signature Status = " + signatureStatus);
}
Show:
© 2014 Microsoft