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


CSSM_GenerateKey

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

Purpose

This function generates a symmetric key.

Format

CSSM_RETURN CSSMAPI CSSM_GenerateKey 
               (CSSM_CC_HANDLE CCHandle,
               uint32 KeyUsage,
               uint32 KeyAttr,
               const CSSM_DATA_PTR KeyLabel,
               CSSM_KEY_PTR Key)

Parameters

Input

CCHandle
The handle that describes the context of this cryptographic operation used to link to the CSP-managed information.
KeyUsage
A bit-mask representing the valid uses of the key. See Table 36 for a list of valid values.
KeyAttr
A bit-mask representing the attributes of the key represented by the data. These attributes are used by CSP service providers to convey information about stored or referenced keys.

Output

Key
Pointer to CSSM_KEY structure containing the key.

Input/optional

KeyLabel
Pointer to a byte string that will be used as a label/identifier for the derived key. If a key label is not used, this field should be set to NULL.

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 KeyData field of the CSSM_KEY structure is not required to be allocated. In this case, the memory required to represent the key is allocated by the CSP. The application is required to free this memory. The CSP will only allocate memory if the Data field of KeyData is NULL and the Length field is zero.

Related Information

CSSM_GenerateRandom
CSSM_GenerateKeyPair

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014