hu_KeyPairGen()

Generate a private and public key object from random data.

Synopsis:

#include "hupkc.h"
 
int hu_KeyPairGen(sb_Params params, sb_PrivateKey *privateKey, sb_PublicKey *publicKey, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

params

A parameters object pointer.

privateKey

The private key object pointer.

publicKey

The public key object pointer.

sbCtx

A global context.

Library:

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

Description:

For ECC and IDLC params objects, the params completely specifies the keys. For RSA, keys are generated with the default public exponent (see hu_RSAKeyGen() for more details).

Returns:

SB_ERR_NULL_PARAMS

The params object is NULL.

SB_ERR_BAD_PARAMS

The tag for the params object is not of the expected type.

SB_ERR_NULL_PRIVATE_KEY

The privateKey object is NULL.

SB_ERR_NULL_PUBLIC_KEY

The publicKey object is NULL.

SB_SUCCESS

Success.