[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
);
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. |
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.
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 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;
}
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in wincrypt.h.
Import Library: Use cryptnet.lib.