Platform SDK: Cryptography |
The CPSetHashParam function customizes the operations of a hash object.
BOOL CPSetHashParam( HCRYPTPROV hProv, // in HCRYPTHASH hHash, // in DWORD dwParam, // in BYTE *pbData, // in DWORD dwFlags // in );
Typically, the hash object specified by hHash will be empty. If this is not the case, an error can be returned.
This parameter gives applications the ability to sign hash values, without having access to the base data. Because the application and the user have no idea what is being signed, this operation is intrinsically risky. It is envisioned that most CSPs will not support this parameter.
Parameters can be added as needed. General-purpose parameters can be define in coordination with Microsoft to promote cross-vendor standardization and allow the new parameter numbers to be added to the standard Win32 header files.
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE, and the appropriate error code from the following table must be set using SetLastError.
Error | Description |
---|---|
NTE_BAD_FLAGS | The dwFlags parameter is non-zero or the pbData buffer contains an invalid value. |
NTE_BAD_HASH | The hash object specified by the hHash parameter is invalid. |
NTE_BAD_TYPE | The dwParam parameter specifies an unknown parameter. |
NTE_BAD_UID | The CSP context that was specified when the hKey key was created cannot now be found. |
NTE_FAIL | The function failed in some unexpected way. |
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 95 OSR2 or later (or Windows 95 with Internet Explorer 3.02 or later).
Header: Declared in Wincrypt.h.