skip book previous and next navigation links
go up to top of book: HP Open Source Security for OpenVMS Volume 1:... HP Open Source Security for OpenVMS Volume 1:...
go to beginning of reference: API FunctionsAPI Functions
go to previous page: FreeKeyFreeKey
go to next page: GenerateKeyGenerateKey
end of book navigation links


GenerateAlgorithmParams
Library
Spi Parameters
Notes For Api
Return Value
See Also
 Api Parameters
Description
Notes For Spi
Errors

NAME

GenerateAlgorithmParams: CSSM_GenerateAlgorithmParams, CSP_GenerateAlgorithmParams - Generate algorithm parameters (CDSA)

SYNOPSIS  

# include <cssm.h>

API:CSSM_RETURN CSSMAPI CSSM_GenerateAlgorithmParams(CSSM_CC_HANDLE CCHandle,uint32 ParamBits,CSSM_DATA_PTR Param)SPI:CSSM_RETURN CSSMCSPI CSP_GenerateAlgorithmParams(CSSM_CSP_HANDLE CSPHandle,CSSM_CC_HANDLE CCHandle,const CSSM_CONTEXT *Context,uint32 ParamBits,CSSM_DATA_PTR Param,uint32 *NumberOfUpdatedAttributes,CSSM_CONTEXT_ATTRIBUTE_PTR *UpdatedAttributes)


return to top LIBRARY  

Common Security Services Manager library (cdsa$incssm300_shr.exe)


return to top API PARAMETERS  

CCHandle (input)
 The handle that describes the context of this cryptographicoperation used to link to the CSP-managed information.
ParamBits (input)
 Used to generate parameters for the algorithm (forexample, Diffie-Hellman).
Param (output)
 Pointer to a CSSM_DATA structure used to provideinformation to the parameter generation process, or to receive informationresulting from the generation process that is not required as aparameter to the algorithm. For instance, phase 2 of the KEA algorithm requiresa private random value, rA, and a public version, Ra, to be generated.The private value, rA, is added to the context and the public value,Ra, is returned to the caller. In some cases, when both input andoutput is required, a data structure is passed to the algorithm. Inthis situation, Param->Data referencesthe structure and Param->Length is setto the length of the structure.


return to top SPI PARAMETERS  

CSPHandle (input)
 The handle that describes the add-in CryptographicService Provider module used to perform up calls to CSSM for thememory functions managed by CSSM.
Context (input)
 Pointer to CSSM_CONTEXT structure that describesthe attributes with this context. Modifying this structure has noeffect on the internal structure maintained by the CSSM. It is onlya copy of the actual data. Changes to the context attributes mustbe returned using the UpdatedAttributes returnparameter.
NumberOfUpdatedAttributes (output)
 The number of CSSM_CONTEXT_ATTRIBUTE structurescontained in the UpdatedAttributes array. Ifthis value is zero, UpdatedAttributes shouldbe set to NULL.
UpdatedAttributes (output)
 An array of attributes that will be added to thecontext should be returned using this parameter. Memory for theattribute structures should be allocated using the CSSM_UPCALLScallbacks provided to the service provider module when CSSM_SPI_ModuleAttach() is called.


return to top DESCRIPTION  

This function generates algorithm parameters for the specifiedcontext. These parameters include Diffie-Hellman keyagreement parameters and DSA key generation parameters. In mostcases the algorithm parameters will be added directly to the cryptographiccontext (by returning an array of CSSM_CONTEXT_ATTRIBUTE structures),but an algorithm may return some data to the caller via the Param parameter.The generated parameters are added to the context as an attributeof type CSSM_ATTRIBUTE_ALG_PARAMS. Other attributes returned areadded to the context, or replace existing values in the context.


return to top NOTES FOR API  

The output is returned to the caller either by filling thecaller-specified buffer or by using the application's declared memoryallocation functions to allocate buffer space. To specify a specific,pre-allocated output buffer, the caller must provide an array ofone or more CSSM_DATA structures each, containing a Length fieldvalue greater than zero and a non-NULL data pointer field value.To specify automatic output buffer allocation by the CSP, the callermust provide an array of one or more CSSM_DATA structures, each containinga Length field value equal to zero and a NULL data pointer fieldvalue. The application is always responsible for deallocating thememory when it is no longer needed.


return to top NOTES FOR SPI  

The output is returned to the caller as specified in BufferManagement for Cryptographic Services.


return to top RETURN VALUE  

A CSSM_RETURN value indicating success or specifying a particularerror condition. The value CSSM_OK indicates success. All othervalues represent an error condition.


return to top ERRORS  

Errors are described in the CDSA Technical Standard.

None specific to this call.


return to top SEE ALSO  

Books

Intel CDSA Application Developer's Guide


go to previous page: FreeKeyFreeKey
go to next page: GenerateKeyGenerateKey