CertVerifyTimeValidity function (wincrypt.h)

The CertVerifyTimeValidity function verifies the time validity of a certificate.


LONG CertVerifyTimeValidity(
  [in] LPFILETIME pTimeToVerify,
  [in] PCERT_INFO pCertInfo


[in] pTimeToVerify

A pointer to a FILETIME structure containing the comparison time. If NULL, the current time is used.

[in] pCertInfo

A pointer to the CERT_INFO structure of the certificate for which the time is being verified.

Return value

Returns a minus one if the comparison time is before the NotBefore member of the CERT_INFO structure. Returns a plus one if the comparison time is after the NotAfter member. Returns zero for valid time for the certificate.


Requirement Value
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header wincrypt.h
Library Crypt32.lib
DLL Crypt32.dll

See also




Data Management Functions