Using the CryptDecryptMessage Function and Associated Structures

Only CryptDecryptMessage is needed to accomplish all of the tasks listed in the previous section. Initialization of structures and other data is necessary first. The following illustration shows the relationship between those function parameters that point to structures or arrays and their initialized data.

    To decrypt data using CryptDecryptMessage
  1. Get a pointer to the encrypted blob.
  2. Get a pointer to a certificate store.
  3. Create a certificate store array.
  4. Initialize the CRYPT_DECRYPT_MESSAGE_PARA structure.
  5. Call CryptDecryptMessage to decrypt the data contained in the message.