CryptFlushTimeValidObject

[This is preliminary documentation and subject to change.]

The CryptFlushTimeValidObject function removes the retrieved object from the cache.

#include <wincrypt.h>
BOOL WINAPI CryptFlushTimeValidObject(
  LPCSTR pszFlushTimeValidOid,     // in
  LPVOID pvPara,                   // in
  PCCERT_CONTEXT pIssuer,          // in
  DWORD dwFlags,                   // in
  LPVOID pvReserved                // in
);
 

Parameters

pszFlushTimeValidOid
Pointer to the object identifier defining the pvPara context type. If the HIWORD of the pszFlushTimeValidOid parameter is zero, the LOWORD specifies the integer identifier for the type of the given structure. Otherwise, this parameter is a long pointer to a null-terminated string.

OIDs extend the functionality of the CryptoAPI. See OID Overview for additional information.

For more details, see the table in CryptEncodeObject/CryptDecodeObject Functions that relates object identifier strings and predefined constants to their corresponding data structures.

The following table lists currently supported OIDs:
OID Meaning
TIME_VALID_OID_FLUSH_CTL Flushes the time valid CTL from the cache.
TIME_VALID_OID_FLUSH_CRL Flushes the time valid CRL from the cache.
TIME_VALID_OID_FLUSH_CRL_
FROM_CERT
Flushes the time valid CRL from the certificate.

pvPara
If the pvPara is not correct for the pszFlushTimeValidOid, program behavior is unspecified.
If the pszFlushTimeValidOid is TIME_VALID_OID_FLUSH_CTL;
pvPara is a PCCTL_CONTEXT. The pointer is to a CTL to flush.
If the pszFlushTimeValidOid is TIME_VALID_OID_FLUSH_CRL;
pvPara is a PCCRL_CONTEXT. The pointer is to a CRL to flush.
If the pszFlushTimeValidOid is TIME_VALID_OID_FLUSH_CRL_FROM_CERT;
pvPara is a PCCERT_CONTEXT. The pointer is to a certification to flush.
pIssuer
Pointer to an issuer context.
dwFlags
Flag values. This parameter is reserved for future use and should always be set to zero.
pvReserved
This parameter is reserved for future use and must be NULL.

Return Values

If the function succeeds, the return value is TRUE. If it does not succeed, the return value is FALSE. To retrieve extended error information, use the GetLastError function.

Remarks

TimeValidDllFlushObject has the same signature as CryptFlushTimeValidObject. The developer can implement a TimeValidDllFlushObject with the signature of CryptFlushTimeValidObject and install it for the OID.

Example

// EXAMPLE CODE FOR USING CryptFlushTimeValidObject().
// Assume that pointers to a CTL context (pvPara) and the
// certificate issuer (pIssuer) are already known.

// Set up the variables.
LPCSTR pszFlushTimeValidOid; //
PCCTL_CONTEXT pvPara;        // Pointer to a PCCTL_CONTEXT to
                             //   have the ThisUpdate and NextUpdate
                             //   times reset- a PCCTL_CONTEXT because
                             //   the OID is a CTL.
PCCERT_CONTEXT pIssuer;      // Pointer to issuer of the certificate
DWORD dwFlags;               // Flag values- future use- set to 0
LPVOID pvReserved;           // Reserved for future use- set to NULL
BOOL fResult;                // Return value- True if function
                             //   successful
                             //   False if function fails

// call to CryptFlushTimeValidObject to get the URL object
fResult= CryptFlushTimeValidObject(
           TIME_VALID_OID_FLUSH_CTL, 
                          // in- pszFlushTimeValidOid
           (LPVOID)pvPara,// in- Initialized elsewhere
           pIssuer,       // in- Initialized elsewhere
           0,             // in- dwFlags- set to 0
           NULL);         // in- Reserved- set to NULL

if (fResult){             // returned value is TRUE
                          //   CryptFlushTimeValidObject is successful
  cout<< "Call to CryptFlushTimeValidObject successful"<< endl;
 }
else {                    // returned value is FALSE
  cout<< "Call to CryptFlushTimeValidObject failed"<< endl
      << "error code = "<< GetLastError<< endl;
}
 

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in wincrypt.h.
  Import Library: Use cryptnet.lib.

See Also

CryptGetTimeValidObject