Retrieves the algorithm identifier, key length and value from a MAC key object.
#include "humac.h"
int hu_MACKeyGet(sb_Key macKey, int *macAlgId, size_t *keyLen, unsigned char *key, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
The MAC key object.
The MAC algorithm identifier.
The length (in bytes) of the MAC key value.
The key value.
A global context.
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 key and its length in keyLen. This function will copy the key value into key and set the actual length of the key value in keyLen.
If key is NULL, then this function will set the correct length of the key value in keyLen. If key 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.
For HMAC algorithms, the maximum value of keyLen will be the underlying hash algorithm's block size.
For cipher-based MAC algorithms, the maximum value of keyLen will be the length for a key of the underlying cipher.
macKey is NULL.
macKey is invalid.
keyLen is NULL.
keyLen is invalid.
macKey cannot be exported.