Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function acquires a specific property from a specified key identifier.

Syntax

BOOL WINAPI CryptGetKeyIdentifierProperty(
  const CRYPT_HASH_BLOB* 
pKeyIdentifier,
  DWORD 
dwPropId,
  DWORD 
dwFlags,
  LPCWSTR 
pwszComputerName,
  void* 
pvReserved,
  void* 
pvData,
  DWORD* 
pcbData
);

Parameters

pKeyIdentifier

[in] Pointer to the CRYPT_HASH_BLOBstructure containing the key identifier.

dwPropId

[in] Specifies the property to retrieve. The value of the dwPropIdparameter determines the type and content of the pvDataparameter. Any certificate property identifier can be used.

dwFlags

[in] Bitmask of flags. The following table shows the defined values for this parameter ,which can be combined with a bitwise ORoperation.

Value Description

CRYPT_KEYID_MACHINE_FLAG

Searches the list of key identifiers of the local machine (if the pwszComputerNameparameter is NULL) or remote computer (if the pwszComputerNameparameter is not NULL).

CRYPT_KEYID_ALLOC_FLAG

The LocalAllocfunction is called to allocate memory for pvData. The * pvDataparameter is updated with a pointer to the allocated memory. LocalFreemust be called to free the allocated memory.

pwszComputerName

[in] Pointer to a name of a remote computer to be searched. If the dwFlagsparameter has a value of CRYPT_KEYID_MACHINE_FLAG, it searches the remote computer for a list of key identifiers. If the local computer is to be searched rather than a remote computer, set the pwszComputerNameparameter to NULL.

pvReserved

[in] Reserved for future use and must be set to NULL.

pvData

[out] Pointer to a buffer to receive the data as determined by the dwPropIdparameter. Elements pointed to by fields in the pvDataparameter follow the structure. Therefore, the size contained in the pcbDataparameter can exceed the size of the structure.

If dwPropIdis CERT_KEY_PROV_INFO_PROP_ID, pvDatapoints to a CRYPT_KEY_PROV_INFOstructure containing the property of the key identifier.

If dwPropIdis not CERT_KEY_PROV_INFO_PROP_ID, pvDatapoints to an array of bytes containing the property of the key identifier.

When CRYPT_KEYID_ALLOC_FLAG is not set, this parameter can be NULL to get the size of this information for memory allocation purposes.

When CRYPT_KEYID_ALLOC_FLAG is set, pvDatais the address of a pointer to the buffer that will be updated. Because memory is allocated and its pointer is stored at * pvData, pvDatamust be non-NULL.

pcbData

[in, out] On input, pointer to a DWORDthat contains the size, in bytes, of the buffer pointed to by the pvDataparameter. On output, the DWORDcontains the number of bytes stored in the buffer. The size contained in the variable pointed to by pcbDatacan indicate a size larger than the CRYPT_KEY_PROV_INFOstructure as the structure can contain pointers to auxiliary data. This size is the sum of the size needed by the structure and all auxiliary data.

When the value of the dwFlagsparameter is CRYPT_KEYID_ALLOC_FLAG, pcibDatais the address of a pointer to the DWORDthat will be updated.

When processing the data returned in the buffer, applications need to use the actual size of the data returned. The actual size can be slightly smaller than the size of the buffer specified on input. On input, buffer sizes are usually specified large enough to ensure that the largest possible output data fits in the buffer. On output, the variable pointed to by this parameter is updated to reflect the actual size of the data copied to the buffer.

Return Value

If the function succeeds, the return value is nonzero, or TRUE.

If the function fails, the return value is zero, or FALSE.

For extended error information, call the GetLastErrorfunction.

Requirements

Header wincrypt.h
Library crypt32.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also