Export (0) Print
Expand All
Expand Minimize

PFN_CMSG_CNG_IMPORT_CONTENT_ENCRYPT_KEY function pointer

The PFN_CMSG_CNG_IMPORT_CONTENT_ENCRYPT_KEY callback function imports an already decrypted content encryption key (CEK). The PFN_CMSG_CNG_IMPORT_CONTENT_ENCRYPT_KEY function can be installed by using a Cryptography API: Next Generation (CNG) object identifier (OID).

Syntax


typedef BOOL ( WINAPI *PFN_CMSG_CNG_IMPORT_CONTENT_ENCRYPT_KEY)(
  _Inout_     PCMSG_CNG_CONTENT_DECRYPT_INFO pCNGContentDecryptInfo,
  _In_        DWORD dwFlags,
  _Reserved_  void *pvReserved
);

Parameters

pCNGContentDecryptInfo [in, out]

A pointer to a CMSG_CNG_CONTENT_DECRYPT_INFO structure to be updated with the imported CEK. This structure contains all the relevant information passed to the CryptMsgControl function.

dwFlags [in]

This parameter is reserved. Set it to zero.

pvReserved

This parameter is reserved. Set it to 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.

If this callback function does not support the key encryption algorithm, it must return FALSE and call SetLastError with ERROR_NOT_SUPPORTED.

Remarks

The CryptMsgControl function calls this function for the following operations specified by its dwCtrlType parameter:

CMSG_CTRL_DECRYPT
CMSG_CTRL_KEY_TRANS_DECRYPT
CMSG_CTRL_KEY_AGREE_DECRYPT

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

ConstantDefinition
CMSG_OID_CNG_IMPORT_CONTENT_ENCRYPT_KEY_FUNC"CryptMsgDllCNGImportContentEncryptKey"

 

Examples

For an example that deploys an OID-installable callback function, see Extending CryptoAPI Functionality.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Wincrypt.h

See also

Decoding Enveloped Data

 

 

Community Additions

ADD
Show:
© 2014 Microsoft