CryptEnumKeyIdentifierProperties (Compact 2013)
3/28/2014
This function enumerates key identifiers and their properties. This function is not called in a loop. Rather, it loops internally until the last key identifier property is enumerated or the callback function returns FALSE. The callback function is called if the dwPropId parameter is zero or if the properties of the key identifier match the dwPropId parameter.
Syntax
BOOL WINAPI CryptEnumKeyIdentifierProperties(
const CRYPT_HASH_BLOB* pKeyIdentifier,
DWORD dwPropId,
DWORD dwFlags,
LPCWSTR pwszComputerName,
void* pvReserved,
void* pvArg,
PFN_CRYPT_ENUM_KEYID_PROP pfnEnum
);
Parameters
pKeyIdentifier
[in] Optional. Pointer to a CRYPT_HASH_BLOB structure containing the key identifier.If the pKeyIdentifier parameter is NULL, the function enumerates all key identifiers.
If the pKeyIdentifier parameter is not NULL, the callback function pfnEnum is only called for the specified key identifier.
dwPropId
[in] Specifies the property identifier to be listed.If the dwPropId parameter is set to zero, this function calls the callback function with all the properties.
If dwPropId is not zero and pKeyIdentifier is NULL, the callback function is called only for those key identifiers that have the specified property. The value of the cProp parameter of the function pointed to by the pfnEnum parameter is set to one. All key identifiers that do not have the property are skipped.
Any certificate property identifier can be used.
- dwFlags
[in] Bitmask of flags. By default, the list of the CurrentUser key identifiers is searched. If this parameter has a value of CRYPT_KEYID_MACHINE_FLAG, the search is instead performed on the list of key identifiers of the LocalMachine if pwszComputerName is NULL, or on the list of key identifiers of a remote computer if pwszComputerName is not NULL.
- pwszComputerName
[in] Optional. Pointer to a name of a remote computer to be searched. If the dwFlags parameter 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, the pwszComputerName parameter is set to NULL.
- pvReserved
[in] Reserved; set to NULL.
- pvArg
[in] Optional. Pointer to data to be passed to the callback function. The type is a void that allows the application to declare, define, and initialize a structure or argument to hold any information.
- pfnEnum
[in] Pointer to an application-defined callback function that is executed for each key identifier entry matching the input parameters. For details about the callback function, see PFN_CRYPT_ENUM_KEYID_PROP.
Return Value
This function repeatedly calls the callback function pointed to by the pfnEnum parameter until the last key identifier is enumerated or the callback returns FALSE.
If the main function succeeds, the return value is nonzero, TRUE.
If the function fails, the return value is zero, or FALSE.
For extended error information, call the GetLastError function.
Remarks
A key identifier can have the same properties as a certificate context.
Requirements
Header |
wincrypt.h |
Library |
crypt32.lib |
See Also
Reference
Certificates Functions
CryptGetKeyIdentifierProperty
CryptSetKeyIdentifierProperty
BLOB (Cryptography)
CRYPT_KEY_PROV_INFO