hu_MACKeyGen()

Creates a key object for the specified MAC algorithm from random data.

Synopsis:

#include "humac.h"
 
int hu_MACKeyGen(int macAlgId, sb_RNGCtx rngCtx, sb_Key *macKey, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

macAlgId

The MAC algorithm identifier.

rngCtx

An RNG context.

macKey

The MAC key object pointer.

sbCtx

A global context.

Library:

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

Description:

macAlgId should be one of the algorithm identifiers defined in this file (e.g. HU_DIGEST_SHA1, HU_MAC_XCBC_AES).

For HMAC algorithms, the length of the generated key will be the digest output length (the minimum recommended in RFC 2104).

For cipher-based MAC algorithms, the length of the generated key will be the length for a key of the underlying cipher.

Returns:

SB_ERR_BAD_MAC_TYPE

macAlgId is unknown.

SB_ERR_NULL_KEY_PTR

macKey is NULL.

Last modified: 2014-05-14



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

comments powered by Disqus