XdCertificateStatus enumeration

Office 2013 and later

The XdCertificateStatus enumeration is used to determine the status of a digital certificate.

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

public enum XdCertificateStatus

Member nameDescription
xdCertificateStatusErrorThe status of the specified digital certificate cannot be determined.
xdCertificateStatusValidThe specified digital certificate is valid.
xdCertificateStatusExpiredThe specified digital certificate has expired.
xdCertificateStatusNotTrustedThe specified digital certificate is not trusted.
xdCertificateStatusRevokedThe specified digital certificate has been revoked.

These enumerated values are returned by the Status property.

public void CertificatePropertiesAlert()
{
 Certificate certificate = thisXDocument.SignedDataBlocks[0].Signatures[0].Certificate;
 string status = "UNKNOWN";
 switch(certificate.Status)
 {
  case XdCertificateStatus.xdCertificateStatusValid :
   status = "VALID";
   break;
  case XdCertificateStatus.xdCertificateStatusError :
   status = "ERROR";
   break;
  case XdCertificateStatus.xdCertificateStatusExpired :
   status = "EXPIRED";
   break;
  case XdCertificateStatus.xdCertificateStatusNotTrusted :
   status = "NOT TRUSTED";
   break;
  case XdCertificateStatus.xdCertificateStatusRevoked :
   status = "REVOKED";
   break;
  default:
   break;
 }
 thisXDocument.UI.Alert("Certificate Status = " + status);
}
Show: