hu_IDLCKeyGet()

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

Synopsis:

#include "huidlc.h"
 
int hu_IDLCKeyGet(sb_Params idlcParams, 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:

idlcParams

An IDLC parameters object.

privateKey

An IDLC private key object.

publicKey

An IDLC 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 keyValue is NULL, then this function will set the correct length of the key value in keyLen. If keyValue is not NULL but keyLen is too small, this function will return an error.

Returns:

SB_ERR_NULL_PARAMS

The idlcParams object is NULL.

SB_ERR_BAD_PARAMS

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

SB_ERR_NULL_INPUT

Both of the private 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_ERR_PRI_KEY_NOT_EXPORTABLE

The private key buffer cannot be retrieved.

SB_SUCCESS

Success.