Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

CertGetValidUsages function

The CertGetValidUsages function returns an array of usages that consist of the intersection of the valid usages for all certificates in an array of certificates.


BOOL WINAPI CertGetValidUsages(
  _In_    DWORD          cCerts,
  _In_    PCCERT_CONTEXT *rghCerts,
  _Out_   int            *cNumOIDs,
  _Out_   LPSTR          *rghOIDs,
  _Inout_ DWORD          *pcbOIDs


cCerts [in]

The number of certificates in the array to be checked.

rghCerts [in]

An array of certificates to be checked for valid usage.

cNumOIDs [out]

The number of valid usages found as the intersection of the valid usages of all certificates in the array. If all of the certificates are valid for all usages, cNumOIDs is set to negative one (–1).

rghOIDs [out]

An array of the object identifiers (OIDs) of the valid usages that are shared by all of the certificates in the rghCerts array. This parameter can be NULL to set the size of this structure for memory allocation purposes. For more information, see Retrieving Data of Unknown Length.

pcbOIDs [in, out]

A pointer to a DWORD value that specifies the size, in bytes, of the rghOIDs array and the strings pointed to. When the function returns, the DWORD value contains the number of bytes needed for the array.

Return value

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. For extended error information, call GetLastError.


Minimum supported client

Windows XP [desktop apps | UWP apps]

Minimum supported server

Windows Server 2003 [desktop apps | UWP apps]