CSSM_CSP_CreateRandomGenContext
CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateRandomGenContext
(CSSM_CSP_HANDLE CSPHandle,
uint32 AlgorithmID,
const CSSM_CRYPTO_DATA_PTR Seed,
uint32 Length)
This function creates a random number generation cryptographic context, given a handle of a CSP, an algorithm identification number, a seed, and the length of the random number in bytes. The cryptographic context handle is returned, and can be used for the random number generation function.
- 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 random number generation.
- Seed (input/optional)
A seed used to generate random number. The caller can either pass a seed and seed length in bytes or pass in a callback function. If NULL is passed, the cryptographic service provider will use its default seed handling mechanism.
- Length (input)
The length of the random number to be generated.
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_GenerateRandom, CSSM_GetContext, CSSM_SetContext, CSSM_DeleteContext, CSSM_GetContextAttribute, CSSM_UpdateContextAttributes
Contents | Next section | Index |