BOOL CryptHashSessionKey( HCRYPTHASH hHash, HCRYPTKEY hKey, DWORD dwFlags );
A handle to the hash object.
A handle to the key object to be hashed.
The following flag value is defined.
||When this flag is set, the bytes of the key are hashed in little-endian form. Note that by default (when dwFlags is zero), the bytes of the key are hashed in big-endian form.|
If the function succeeds, the return value is TRUE.
If the function fails, the return value is 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.|
||One of the parameters contains a value that is not valid. This is most often a pointer that is not valid.|
||The hHash handle specifies an algorithm that this CSP does not support.|
||The dwFlags parameter is nonzero.|
||The hash object specified by the hHash parameter is not valid.|
||An attempt was made to add data to a hash object that is already marked "finished."|
||A keyed hash algorithm is being used, but the session key is no longer valid. This error is generated if the session key is destroyed before the hashing operation is complete.|
||The CSP context that was specified when the hash object was created cannot be found.|
||The function failed in some unexpected way.|
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|