PFN_CMSG_EXPORT_MAIL_LIST callback function (wincrypt.h)

The PFN_CMSG_EXPORT_MAIL_LIST callback function encrypts and exports the content encryption key for a mailing list recipient of an enveloped message. PFN_CMSG_EXPORT_MAIL_LIST can be installed by using a CryptoAPI object identifier (OID). This function is called by the CryptMsgOpenToEncode function when its dwMsgType parameter is set to CMSG_ENVELOPED.

Syntax

PFN_CMSG_EXPORT_MAIL_LIST PfnCmsgExportMailList;

BOOL PfnCmsgExportMailList(
  [in]      PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo,
  [in]      PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO pMailListEncodeInfo,
  [in, out] PCMSG_MAIL_LIST_ENCRYPT_INFO pMailListEncryptInfo,
  [in]      DWORD dwFlags,
            void *pvReserved
)
{...}

Parameters

[in] pContentEncryptInfo

A pointer to a CMSG_CONTENT_ENCRYPT_INFO structure that contains the content encryption key.

[in] pMailListEncodeInfo

A pointer to a CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO structure that specifies the key used to encrypt the content encryption key.

[in, out] pMailListEncryptInfo

A pointer to a CMSG_MAIL_LIST_ENCRYPT_INFO structure that contains the encrypted content encryption key.

[in] dwFlags

This value is not used. Set it to zero.

pvReserved

This parameter is reserved and must be NULL.

Return value

If the function succeeds, the return value is nonzero (TRUE).

If the function fails, the return value is zero (FALSE). For extended error information, call GetLastError.

Remarks

The PFN_CMSG_EXPORT_MAIL_LIST function must update the EncryptedKey member of the CMSG_MAIL_LIST_ENCRYPT_INFO structure pointed to by the pMailListEncryptInfo parameter. This function must use the pfnAlloc and pfnFree members of the CMSG_CONTENT_ENCRYPT_INFO structure pointed to by the pContentEncryptInfo parameter to manage memory for any values that it updates.

You can use OID Support Functions to deploy this callback function. Wincrypt.h defines the following constants for this purpose.

Constant Definition
CMSG_OID_EXPORT_MAIL_LIST_FUNC or CMSG_OID_CAPI1_EXPORT_MAIL_LIST_FUNC "CryptMsgDllExportMailList"

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header wincrypt.h