Decode Hashed Data
The following two procedures allow you to decode and then verify hashed data.
To decode hashed data
-
Get a pointer to the encoded blob.
-
Call CryptMsgOpenToDecode, passing the necessary arguments.
-
Call CryptMsgUpdate once, passing in the handle retrieved in step 2, and a pointer to the data that is to be decoded. This causes the appropriate actions to be taken on the message, depending on the message type.
-
Call CryptMsgGetParam, passing in the handle retrieved in step 2, and the appropriate parameter types to access the desired, decoded data. For example, pass in CMSG_CONTENT_PARAM to get a pointer to the decoded content.
To verify the hash
-
Call CryptMsgControl, passing in CMSG_CTRL_VERIFY_HASH to verify the hashes.
-
Call CryptMsgClose to close the message.