Share via


CryptSetKeyIdentifierProperty

This function sets the property of a specified key identifier. This function can set the property on the computer identified in the pwszComputerName parameter.

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

Parameters

  • pKeyIdentifier
    [in] Pointer to a CRYPT_HASH_BLOB structure containing the key identifier.

  • dwPropId
    [in] Identifies the property to be set. The value of the dwPropId parameter determines the type and content of the pvData parameter. Any certificate property ID can be used. CERT_KEY_PROV_INFO_PROP_ID is the property of most interest.

  • dwFlags
    [in] The following table shows the defined dwFlags, which can be combined with a bitwise OR operation.

    Value Description
    CRYPT_KEYID_MACHINE_FLAG Sets the property of the LocalMachine (if the pwszComputerName parameter is NULL) or remote computer (if the pwszComputerName parameter is not NULL).
    CRYPT_KEYID_DELETE_FLAG The key identifier and all of its properties are deleted.
    CRYPT_KEYID_SET_NEW_FLAG Sets a new key identifier property. If the property already exists, the attempt fails and FALSE is returned with the last error code set to CRYPT_E_EXISTS.
  • pwszComputerName
    [in] Pointer to a name of a remote computer that has the key identifier where the properties are set. If CRYPT_KEYID_MACHINE_FLAG is set, it searches the remote computer for a list of key identifiers. If the local computer is to be set and not a remote computer, set the pwszComputerName parameter to NULL.

  • pvReserved
    [in] Reserved for future use and must be NULL.

  • pvData
    [out] If dwPropId is CERT_KEY_PROV_INFO_PROP_ID, pvData points to a CRYPT_KEY_PROV_INFO structure containing the property of the key identifier.

    If dwPropId is not CERT_KEY_PROV_INFO_PROP_ID, pvData points to a CRYPT_DATA_BLOB structure containing the property of the key identifier.

    Setting pvData to NULL deletes the property.

Return Values

If the function succeeds, the return value is nonzero (TRUE).

If the function fails, the return value is zero (FALSE).

For extended error information, call the GetLastError function.

**Note   **If CRYPT_KEYID_SET_NEW_FLAG is set and the property already exists, FALSE is returned with the last error code set to CRYPT_E_EXISTS.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 3.0 or later Wincrypt.h   Crypt32.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CryptEnumKeyIdentifierProperties, CryptGetKeyIdentifierProperty, CRYPT_HASH_BLOB, CRYPT_KEY_PROV_INFO

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.