Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

CertificateObject Interface (Microsoft.Office.Interop.InfoPath.SemiTrust)

Represents the X.509 digital certificate that has been used to create a signature.


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

public interface CertificateObject : Certificate

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 Certificate.

Use the Certificate property of the SignatureObject object to return a Certificate object.

The following example uses several properties of the Certificate object to determine the status, and displays a message box with several Certificate object properties:

public void CertificatePropertiesAlert()
 Certificate myCertificate = thisXDocument.SignedDataBlocks[0].Signatures[0].Certificate;
 string status = "Undefined";
  case XdCertificateStatus.xdCertificateStatusValid :
   status = "Valid";
  case XdCertificateStatus.xdCertificateStatusError :
   status = "Error";
  case XdCertificateStatus.xdCertificateStatusExpired :
   status = "Expired";
  case XdCertificateStatus.xdCertificateStatusNotTrusted :
   status = "Not Trusted";
  case XdCertificateStatus.xdCertificateStatusRevoked :
   status = "Revoked";
  thisXDocument.UI.Alert(" IssuedTo = " + myCertificate.IssuedTo + "\n IssuedBy = " + myCertificate.IssuedBy + "\n ExpirationDate = " + myCertificate.ExpirationDate + "\n Status = " + status);

Community Additions

© 2015 Microsoft