Share via


CryptSetKeyIdentifierProperty

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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

Syntax

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] Specifies the property to be set. The value of the dwPropId parameter determines the type and content of the pvData parameter. Any certificate property identifier can be used. CERT_KEY_PROV_INFO_PROP_ID is the property of most interest.
  • dwFlags
    [in] Bitmask of flags. The following table shows the defined values for this parameter*,* 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 set to NULL.
  • pvData
    [out] If the value of the dwPropId parameter is CERT_KEY_PROV_INFO_PROP_ID, the pvData parameter points to a CRYPT_KEY_PROV_INFO structure containing the property of the key identifier.

    If the dwPropId parameter does not have a value of CERT_KEY_PROV_INFO_PROP_ID, the pvData parameter points to a CRYPT_DATA_BLOB structure containing the property of the key identifier.

    Setting pvData to NULL deletes the property.

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 GetLastError function.

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

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

Reference

CryptEnumKeyIdentifierProperties
CryptGetKeyIdentifierProperty
BLOB (Cryptography)
CRYPT_KEY_PROV_INFO