Creates a key object for the specified MAC algorithm from the given key value.
#include "humac.h"
int hu_MACKeySet(int macAlgId, size_t keyLen, const unsigned char *key, sb_Key *macKey, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
The MAC algorithm identifier.
The length (in bytes) of the MAC key value.
The MAC key value.
The MAC key object pointer.
A global context.
macAlgId should be one of the algorithm identifiers defined in this file (e.g. HU_DIGEST_SHA1, HU_MAC_XCBC_AES).
For HMAC algorithms, if keyLen is larger than the block size of the specified hash function, the key will first be hashed and the resulting digest will be used as the key (as described in RFC 2104). hu_MACKeyGet() will return this digest as the key value.
For cipher-based MAC algorithms, keyLen must be the appropriate length for a key of the underlying cipher.
macAlgId is unknown.
macKey is NULL.
key is NULL.