CSSM_CSP_CreateSymmetricContext
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)
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.
- 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.
Returns a cryptographic context handle. If the handle is NULL, an error has occurred. Use CSSM_GetError to obtain the error code.
- CSSM__INVALID_CSP_HANDLE
Invalid provider handle.
- CSSM__MEMORY_ERROR
Internal memory error.
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
Contents | Next section | Index |