CertVerifyTimeValidity

The CertVerifyTimeValidity function verifies the time validity of a certificate.

#include <wincrypt.h>
LONG WINAPI CertVerifyTimeValidity(
  LPFILETIME pTimeToVerify,     // in
  PCERT_INFO pCertInfo          // in
);
 

Parameters

pTimeToVerify
A pointer to the time to be verified. If set to NULL the current time is used.
pCertInfo
A pointer to the certificate for which the time is being verified.

Return Values

Returns a minus one if the time being verified is before "NotBefore". Returns a plus one if the time being verified is after "NotAfter". Returns zero for valid time for the certificate.

Example

See Certificate Management Example Code.

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later. Available also in IE 3.02 and later.
  Windows: Requires Windows 98 (or Windows 95 with IE 3.02 or later).
  Windows CE: Unsupported.
  Header: Declared in wincrypt.h.
  Import Library: Use crypt32.lib.

See Also

CertVerifyCRLTimeValidity, CertVerifyCRLRevocation, CertVerifyValidityNesting