hu_ECCKeySet()

Creates an ECC private and/or public key object from the given key value(s).

Synopsis:

#include "huecc.h"
 
int hu_ECCKeySet(sb_Params eccParams, size_t privateKeyLen, const unsigned char *privateKeyValue, size_t publicKeyLen, const unsigned char *publicKeyValue, sb_PrivateKey *privateKey, sb_PublicKey *publicKey, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

eccParams

An ECC parameters object.

privateKeyLen

The length (in bytes) of the private key value.

privateKeyValue

The private key value.

publicKeyLen

The length (in bytes) of the public key value.

publicKeyValue

The public key value.

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:

If both the private and public key values are supplied, then a private key and/or a public key object can be created. These objects will be created from the corresponding key values.

If only a private key value is supplied, then a private key and/or a public key object can be created. The public key will be computed from the private key.

If only a public key value is supplied, then only a public key object can be created.

Returns:

SB_ERR_NULL_PARAMS

The eccParams object is NULL.

SB_ERR_BAD_PARAMS

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

SB_ERR_NULL_PRI_KEY_BUF

The private key value is NULL.

SB_ERR_BAD_PRI_KEY_BUF_LEN

The private key length is invalid.

SB_ERR_NULL_PUB_KEY_BUF

The public key value is NULL.

SB_ERR_BAD_PUB_KEY_BUF_LEN

The public key length is invalid.

SB_ERR_BAD_INPUT

The public key value is invalid.

SB_FAIL_INVALID_PRIVATE_KEY

The private key value is invalid.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.

Last modified: 2014-05-14



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus