Previous section.

Common Security: CDSA and CSSM
Copyright © 1997 The Open Group

NAME

CSSM_CSP_CreateSymmetricContext

SYNOPSIS

CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateSymmetricContext
    (CSSM_CSP_HANDLE CSPHandle,
    uint32 AlgorithmID,
    uint32 Mode,
    const CSSM_KEY_PTR Key,
    const CSSM_DATA_PTR InitVector,
    CSSM_PADDING Padding,
    uint32 Params)

DESCRIPTION

This function creates a symmetric encryption cryptographic context given a handle of a CSP, an algorithm identification number, a key, an initial vector, padding, and the number of encryption rounds. The cryptographic context handle is returned. The cryptographic context handle can be used to call symmetric encryption functions and the cryptographic wrap/unwrap functions.

PARAMETERS

CSPHandle (input)

The handle that describes the add-in cryptographic service provider module used to perform this function. If a NULL handle is specified, CSSM returns error.

AlgorithmID (input)

The algorithm identification number for symmetric encryption.

Mode (input)

The mode of the specified algorithm ID.

Key (input)

The key used for symmetric encryption. The caller passes in a pointer to a CSSM_KEY structure containing the key. This key can be used directly for wrap and unwrap operations.

InitVector (input/optional)

The initial vector for symmetric encryption; typically specified for block ciphers.

Padding (input/optional)

The method for padding; typically specified for ciphers that pad.

Params (input/optional)

Specifiesany additional parameters required to perform encryption using the specified algorithm.

RETURN VALUE

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

ERRORS

CSSM__INVALID_CSP_HANDLE

Invalid provider handle.

CSSM__MEMORY_ERROR

Internal memory error.

SEE ALSO

CSSM_EncryptData, CSSM_QuerySize, CSSM_EncryptDataInit,
CSSM_EncryptDataUpdate, CSSM_EncryptDataFinal,
CSSM_DecryptData, CSSM_DecryptDataInit,
CSSM_DecryptDataUpdate, CSSM_DecryptDataFinal,
CSSM_GetContext, CSSM_SetContext, CSSM_DeleteContext,
CSSM_GetContextAttribute, CSSM_UpdateContextAttributes

Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.
You should also read the legal notice explaining the terms and conditions relating to the CDSA documentation.

Contents Next section Index