Windows Dev Center

EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY function pointer

The PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY callback function generates the symmetric key used to encrypt content for an enveloped message. This function is called by the CryptMsgOpenToEncode function when it initializes the CMSG_CONTENT_ENCRYPT_INFO structure.

Syntax


typedef BOOL ( WINAPI *PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY)(
  _Inout_    PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo,
  _In_       DWORD                      dwFlags,
  _Reserved_ void                       *pvReserved
);

Parameters

pContentEncryptInfo [in, out]

A pointer to a CMSG_CONTENT_ENCRYPT_INFO structure that contains the key.

dwFlags [in]

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

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

You must define different callback functions for CAPI1 keys and Cryptography API: Next Generation (CNG) keys. Both functions have the same signature but use different object identifiers (OIDs). Which function is called depends on the value of the fCNG member of the CMSG_CONTENT_ENCRYPT_INFO structure pointed to by the pContentEncryptInfo parameter. The following table shows the relationship between the callback function and the value of the fCNG member.

fCNG valueConstantDefinition
FALSECMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC or CMSG_OID_CAPI1_GEN_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllGenContentEncryptKey"
TRUECMSG_OID_CNG_GEN_CONTENT_ENCRYPT_KEY_FUNC"CryptMsgDllCNGGenContentEncryptKey"

 

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Wincrypt.h

 

 

Community-Beiträge

HINZUFÜGEN
Anzeigen:
© 2015 Microsoft