hu_DESKeyGet()

Retrieves the key values and their lengths from an DES key object.

Synopsis:

#include "hudes.h"
 
int hu_DESKeyGet(sb_Params desParams, sb_Key desKey, size_t *key1Len, unsigned char *key1Value, size_t *key2Len, unsigned char *key2Value, size_t *key3Len, unsigned char *key3Value, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

desParams

A DES parameters object.

desKey

A DES key object pointer.

key1Len

The length (in bytes) of key1Value.

key1Value

Key 1 value.

key2Len

The length (in bytes) of key2Value. Ignored if the mode is SB_DES_DES.

key2Value

Key 2 value. Ignored if the mode is SB_DES_DES.

key3Len

The length (in bytes) of key3Value. Ignored if the mode is SB_DES_DES.

key3Value

Key 3 value. Ignored if the mode is SB_DES_DES.

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

Key object is NULL.

SB_ERR_BAD_KEY

Key object is invalid.

SB_ERR_NULL_KEY_LEN

Key length is NULL.

SB_ERR_BAD_OUTPUT_BUF_LEN

Key value buffer length is invalid.

SB_SUCCESS

Success.