z/OS Open Cryptographic Services Facility Application Programming
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF


CSSM_CSP_CreateSymmetricContext

z/OS Open Cryptographic Services Facility Application Programming
SC24-5899-01

Purpose

On z/OS, when any CSSM_CSP_CreateSymmetricContext 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 symmetric encryption cryptographic context and returns a handle to the context. The cryptographic context handle can be used to call symmetric encryption functions and the cryptographic wrap/unwrap functions.

Format

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,
                   uint32 Padding,
                   uint32 Params)

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 symmetric encryption.
Mode
The mode of the specified algorithm ID.
Key
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.

Input/optional

InitVector
The initial vector for symmetric encryption; typically specified for block ciphers.
Padding
The method for padding; typically specified for ciphers that pad.
Params
Specifies the number of rounds of encryption; used for ciphers with variable number of rounds, such as RC5. For ciphers such as RC2, this parameter specifies the effective key size in bits.

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_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

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014