CertGetServerOcspResponseContext function (wincrypt.h)

The CertGetServerOcspResponseContext function retrieves a non-blocking, time valid online certificate status protocol (OCSP) response context for the specified handle.

Syntax

PCCERT_SERVER_OCSP_RESPONSE_CONTEXT CertGetServerOcspResponseContext(
  [in] HCERT_SERVER_OCSP_RESPONSE hServerOcspResponse,
  [in] DWORD                      dwFlags,
       LPVOID                     pvReserved
);

Parameters

[in] hServerOcspResponse

The OCSP server response handle for which to retrieve a response context. This handle is returned by the CertOpenServerOcspResponse function.

[in] dwFlags

This parameter is reserved for future use and must be zero.

pvReserved

This parameter is reserved for future use and must be NULL.

Return value

If the function succeeds, it returns a pointer to a CERT_SERVER_OCSP_RESPONSE_CONTEXT structure.

For a response to be time valid, the current time on the system hosting this function call must be less than the next update time for the certificate revocation list (CRL) context. When a time valid OCSP response is not available, this function returns NULL with the last error set to CRYPT_E_REVOCATION_OFFLINE.

If the certificate is unknown by the OCSP responder, this function returns NULL with the last error set to CRYPT_E_REVOCATION_OFFLINE.

Remarks

If you use the CertGetServerOcspResponseContext function to create multiple references to an OCSP response context, you must call CertAddRefServerOcspResponseContext to increment the reference count for the CERT_SERVER_OCSP_RESPONSE_CONTEXT structure. When you have finished using the structure, you must free it by calling the CertFreeServerOcspResponseContext function.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header wincrypt.h
Library Crypt32.lib
DLL Crypt32.dll