12
CryptHashSessionKey
The CryptHashSessionKey function computes the cryptographic hash of a key object. This function
can be called multiple times with the same hash handle to compute the hash of multiple keys. Calls to
CryptHashSessionKey can be interspersed with calls to CryptHashData. Before calling this function,
the CryptCreateHash function must be called to create the handle of a hash object.
CryptSetHashParam
The CryptSetHashParam function customizes the operations of a hash object. For creating a HMAC
hash associated with a hash object identified the hHash handle, the caller uses the
CryptSetHashParam function with the HP_HMAC_INFO flag to specify the necessary SHA-1 algorithm
using the CALG_SHA1 flag in the input HMAC_INFO structure. There is no need for the caller to
specify the HMAC inner or outer strings as the cryptographic service provider is using the inner and
outer string values as documented in the Draft FIPS for HMAC as its default values.
CryptSignHash
The CryptSignHash function signs data. Because all signature algorithms are asymmetric and thus
slow, the CryptoAPI does not allow data be signed directly. Instead, data is first hashed and
CryptSignHash is used to sign the hash. The crypto module supports signing with RSA. The X9.31
format may be specified by a flag.
CryptVerifySignature
The CryptVerifySignature function verifies the signature of a hash object. Before calling this function,
the CryptCreateHash function must be called to create the handle of a hash object. CryptHashData or
CryptHashSessionKey is then used to add data or session keys to the hash object. The crypto module
supports verifying RSA signatures. The X9.31 format may be specified by a flag.
After this function has been completed, only CryptDestroyHash can be called using the hHash handle.
CryptDuplicateHash
The CryptDuplicateHash function is used to duplicate, make a copy of, the state of a hash and returns
a handle to this new hash. The CryptDestroyHash function must be used on both the handle to the
original hash and the newly duplicated hash.