CSSM_GenerateRandom
Purpose
This function generates random data.
Format
CSSM_RETURN CSSMAPI CSSM_GenerateRandom (CSSM_CC_HANDLE CCHandle,CSSM_DATA_PTR RandomNumber)Parameters
Input
- CCHandle
- The handle that describes the context of this cryptographic operation used to link to the CSP-managed information.
Output
- RandomNumber
- Pointer to CSSM_DATA structure used to obtain the random number and the size of the random number in bytes.
Return Value
CSSM_OK if the function was successful. CSSM_FAIL if an error occurred. Use CSSM_GetError to determine the exact error.
Notes
The output can be obtained either by filling the caller-supplied buffer or using the application's memory allocation functions to allocate space, which the application must later free. If the output buffer pointer is NULL, an error code CSSM_CSP_INVALID_DATA_POINTER is returned.