CSSM_CSP_CreateMacContext

Purpose

On z/OS, when any CSSM_CSP_CreateMacContext operation is invoked, a copy of the context is created. The pointer to the copy is returned on all CSSM_GetContext calls.

This function creates a Message Authentication Code (MAC) cryptographic context and returns a handle to the context. The cryptographic context handle can be used to call MAC functions. Note that MAC contexts that use RC2 require an effective key size in bits attribute. To add this attribute, use CSSM_UpdateContextAttributes.

Format

CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateMacContext(CSSM_CSP_HANDLE CSPHandle,
                                                 uint32 AlgorithmID,
                                                 const CSSM_KEY_PTR Key)

Parameters

Input
CSPHandle
The handle that describes the CSP module used to perform this function. If a NULL handle is specified, OCSF returns an error.
AlgorithmID
The algorithm identification number for the MAC algorithm.
Key
The key used to generate a MAC. The caller passes in a pointer to a CSSM_KEY structure containing the key.

Return Value

Returns a cryptographic context handle. If the handle is NULL, an error has occurred. Use CSSM_GetError to obtain the error code.

Related Information

CSSM_GenerateMac
CSSM_GenerateMacInit
CSSM_GenerateMacUpdate
CSSM_GenerateMacFinal
CSSM_VerifyMAC
CSSM_VerifyMacInit
CSSM_VerifyMACUpdate
CSSM_VerifyMACFinal
CSSM_GetContext
CSSM_SetContext
CSSM_DeleteContext
CSSM_GetContextAttribute
CSSM_UpdateContextAttributes