hu_ARC2KeyGet()

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

Synopsis:

#include "huarc2.h"
 
int hu_ARC2KeyGet(sb_Params arc2Params, sb_Key arc2Key, size_t *keyLen, unsigned char *keyValue, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

arc2Params

An ARC2 parameters object.

arc2Key

An ARC2 key object.

keyLen

The length (in bytes) of the ARC2 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 arc2Key key object is NULL.

SB_ERR_BAD_KEY

The arc2Key key object is invalid.

SB_ERR_NULL_KEY_LEN

keyLen is NULL.

SB_ERR_BAD_OUTPUT_BUF_LEN

keyLen, the key value buffer length, is invalid.

SB_SUCCESS

Success.