Previous section.

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

NAME

CSSM_CSP_CreateRandomGenContext

SYNOPSIS

CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateRandomGenContext
    (CSSM_CSP_HANDLE CSPHandle,
    uint32 AlgorithmID,
    const CSSM_CRYPTO_DATA_PTR Seed,
    uint32 Length)

DESCRIPTION

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.

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

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_GenerateRandom, 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