CRYPT_HASH_MESSAGE_PARA

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;
 

Members

cbSize
Must be set to the size of this data structure.
dwMsgEncodingType
The type of message encoding used. Note that it is always acceptable to specify both the certificate and message encoding types, by combining them with a bitwise OR operation as shown in the following example:
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

hCryptProv
Specifies a handle to the cryptographic service provider (CSP) to be used.

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.

HashAlgorithm
The algorithm for use in generating the hash of a message, for example, szOID_OIWSEC_sha1 or szOID_RSA_MD5.
pvHashAuxInfo
Not currently used, and must be set to NULL.

See Also

CRYPT_ALGORITHM_IDENTIFIER, CryptHashMessage, CryptVerifyDetachedMessageHash, CryptVerifyMessageHash