BOOL CryptSetHashParam( HCRYPTHASH hHash, DWORD dwParam, const BYTE *pbData, DWORD dwFlags );
A handle to the hash object on which to set parameters.
This parameter can be one of the following values.
||A pointer to an HMAC_INFO structure that specifies the cryptographic hash algorithm and the inner and outer strings to be used.|
A byte array that contains a hash value to place directly into the hash object. Before setting this value, the size of the hash value must be determined by using the
CryptGetHashParam function to read the HP_HASHSIZE value.
Some cryptographic service providers (CSPs) do not support this capability.
A value data buffer. Place the value data in this buffer before calling CryptSetHashParam. The form of this data varies, depending on the value number.
This parameter is reserved for future use and must be set to zero.
If the function succeeds, the function returns TRUE.
If the function fails, it returns FALSE. For extended error information, call GetLastError.
The error codes prefaced by "NTE" are generated by the particular CSP you are using. Some possible error codes follow.
||One of the parameters specifies a handle that is not valid.|
||The CSP context is currently being used by another process.|
||One of the parameters contains a value that is not valid. This is most often a pointer that is not valid.|
||The dwFlags parameter is nonzero or the pbData buffer contains a value that is not valid.|
||The hash object specified by the hHash parameter is not valid.|
||The dwParam parameter specifies an unknown value.|
||The CSP context that was specified when the hKey key was created cannot be found.|
||The function failed in some unexpected way.|
Occasionally, a hash value that has been generated elsewhere must be signed. This can be done by using the following sequence of operations:
- Create a hash object by using CryptCreateHash.
- Set the HP_HASHVAL value.
- Sign the hash value by using CryptSignHash and obtain a digital signature block.
- Destroy the hash object by using CryptDestroyHash.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|