hu_ECCKeyGet()

Retrieves the key values and their lengths from an ECC private and/or public key object.

Synopsis:

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

Since:

BlackBerry 10.0.0

Arguments:

eccParams

An ECC parameters object.

privateKey

An ECC private key object.

publicKey

An ECC public key object.

privateKeyLen

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

privateKeyValue

The private key buffer.

publicKeyLen

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

publicKeyValue

The public key buffer.

sbCtx

A global context.

Library:

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

Description:

If the length of the key value is known, a pointer to a buffer large enough to hold the key value should be passed in the key value buffer and its length in the corresponding length argument. This function will copy the key value into the buffer and set the actual length of the key value in the length argument.

If key value buffer is NULL, then this function will set the correct length of the key value in the length argument. If the buffer is not NULL but buffer length is too small, this function will return an error and also will set the correct length of the key value in length argument.

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_INPUT

Both the private key and public key objects are NULL.

SB_ERR_BAD_PRIVATE_KEY

The private key object is invalid.

SB_ERR_BAD_PRI_KEY_BUF_LEN

The private key buffer length is invalid.

SB_ERR_BAD_PUBLIC_KEY

The public key object is invalid.

SB_ERR_BAD_PUB_KEY_BUF_LEN

The public key buffer length is invalid.

SB_ERR_NULL_KEY_LEN

The length of the key buffer is NULL.

SB_SUCCESS

Success.

Last modified: 2014-05-14



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

comments powered by Disqus