The CRYPT_HASH_MESSAGE_PARA structure is used for hashing messages.
typedef struct _ CRYPT_HASH_MESSAGE_PARA {
DWORD cbSize;
DWORD dwMsgEncodingType;
HCRYPTPROV hCryptProv;
CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
void* pvHashAuxInfo;
} CRYPT_HASH_MESSAGE_PARA, *PCRYPT_HASH_MESSAGE_PARA;
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING
However, it is required only to specify the message encoding here. Currently defined encoding types are shown in the following table.
Encoding type | Value |
---|---|
X509_ASN_ENCODING | 0x00000001 |
PKCS_7_ASN_ENCODING | 0x00010000 |
Unless there is a strong reason for passing in a specific cryptographic provider in hCryptProv, zero should be passed in. Passing in zero causes the default RSA or DSS provider to be acquired before doing hash, signature verification or recipient encryption operations.
CRYPT_ALGORITHM_IDENTIFIER, CryptHashMessage, CryptVerifyDetachedMessageHash, CryptVerifyMessageHash