hu_RSAParamsCreate()

Creates an RSA parameters object for the specified modulus size.

Synopsis:

#include "hursa.h"
 
int hu_RSAParamsCreate(size_t modulusSize, sb_RNGCtx rngContext, sb_YieldCtx yieldCtx, sb_Params *rsaParams, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

modulusSize

The length (in bits) of the RSA modulus. This value must be greater than or equal to 512.

rngContext

An RNG context. (Optional - set to NULL if key generation and encryption will not be performed.)

yieldCtx

A yield context. (Optional - set to NULL if yielding is not required.)

rsaParams

The RSA parameters object pointer.

sbCtx

A global context.

Library:

libhuapi (For the qcc command, use the -l huapi option to link against this library)

Description:

An RNG context must be supplied if key generation or encryption will be performed. A yielding context must be supplied if yielding will be performed.

Returns:

SB_ERR_BAD_INPUT

The modulus size is invalid.

SB_ERR_NULL_PARAMS_PTR

The rsaParams object pointer is NULL.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.