hu_ARC4KeyGet()

Retrieves the key value and its length from an ARC4 key object.

Synopsis:

#include "huarc4.h"
 
int hu_ARC4KeyGet(sb_Params arc4Params, sb_Key arc4Key, size_t *keyLen, unsigned char *keyValue, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

arc4Params

An ARC4 parameters object.

arc4Key

An ARC4 key object.

keyLen

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

keyValue

The key value.

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 keyValue and its length in keyLen. This function will copy the key value into keyValue and set the actual length of the key value in keyLen.

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 and also will set the correct length of the key value in keyLen.

Returns:

SB_ERR_NULL_KEY

The arc4Key object is NULL.

SB_ERR_BAD_KEY

The arc4Key object is invalid.

SB_ERR_NULL_KEY_LEN

keyLen is NULL.

SB_ERR_BAD_OUTPUT_BUF_LEN

The length of the keyValue buffer is invalid.

SB_SUCCESS

Success.