Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SignatureObject Interface
Collapse the table of content
Expand the table of content

SignatureObject Interface (Microsoft.Office.Interop.InfoPath)

Represents a digital signature that has been added to a form or set of signed data in a form.

Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)

public interface SignatureObject : Signature

This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, see Signature.

Use the Item property of the SignaturesCollection collection to return a Signature object.

In the following example, the Status property of the Signature object is used to determine the status of the signature, and several Signature object properties are displayed in message boxes:

public void DisplaySignatureProperties()
SignatureObject mySignature = thisXDocument.SignedDataBlocks[0].Signatures[0];
CertificateObject signatureCertificate = mySignature.Certificate;
string signatureComment = mySignature.Comment;
IXMLDOMNode signatureNode = mySignature.SignatureBlockXmlNode;
string signatureStatus = "Unknown";
 case XdSignatureStatus.xdSignatureStatusValid : 
  signatureStatus = "Valid";
 case XdSignatureStatus.xdSignatureStatusInvalid : 
  signatureStatus = "Invalid";
 case XdSignatureStatus.xdSignatureStatusError :
  signatureStatus = "Error";
 case XdSignatureStatus.xdSignatureStatusUnsupported :
  signatureStatus = "Unsupported";
thisXDocument.UI.Alert("Signature properties:\n Status = " + signatureStatus + "\n Comment = " + signatureComment + "\n Certificate Issued To = " + signatureCertificate.IssuedTo);
thisXDocument.UI.Alert("Digital signature XML block: \n" + signatureNode.xml);

Community Additions

© 2015 Microsoft