generateMacWithHmacSha256

Generates an HMAC-SHA256 tag for this string using the specified or generated key.

Return

A Result containing the HMAC tag and the key used.

Parameters

key

The key to use for HMAC computation (default: a newly generated key via generateKey).