CMSG_CTRL_DECRYPT_PARA

The CMSG_CTRL_DECRYPT_PARA structure is used for an enveloped message. This structure is passed to CryptMsgControl for a value of CMSG_CTRL_DECRYPT in dwCtrlType.

Important changes have been made to the CryptoAPI in order to support S/MIME e-mail interoperability, which affect the handling of enveloped messages. See the Remarks for CryptMsgOpenToEncode for details.

typedef struct _CMSG_CTRL_DECRYPT_PARA {
    DWORD                    cbSize;
    HCRYPTPROV               hCryptProv;
    DWORD                    dwKeySpec;
    DWORD                    dwRecipientIndex;
} CMSG_CTRL_DECRYPT_PARA,   *PCMSG_CTRL_DECRYPT_PARA;
 

Members

cbSize
The count of bytes in this data structure.
hCryptProv
A handle to the cryptographic service provider.
dwKeySpec
Used to specify the private key to be used.

The following dwKeySpec values are defined in Wincrypt.h for the default provider:

#define AT_KEYEXCHANGE              1
#define AT_SIGNATURE                2
 

If dwKeySpec is zero, then the default AT_KEYEXCHANGE is used.

dwRecipientIndex
The index of the recipient in the message associated with the hCryptProv's private key.

See Also

CryptMsgControl