Retrieves the algorithm identifier, key length and value from a MAC key object.
int hu_MACKeyGet(sb_Key macKey, int *macAlgId, size_t *keyLen, unsigned char *key, sb_GlobalCtx sbCtx)
The MAC key object.
The MAC algorithm identifier.
The length (in bytes) of the MAC key value.
The key value.
A global context.
Library:libhuapi (For the qcc command, use the -l huapi option to link against this library)
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.
Last modified: 2014-05-14