Hi Diederik,
The community commons libary has this functionality. From the documentation:
*GenerateHMAC_SHA256_hash - Generates a base64 encoded asymmetric hash using the HMAC_SHA256 hash algorithm.
*GenerateHMAC_SHA256 - Generates a hexadecimal encoded asymmetric hash using the HMAC_SHA256 hash algorithm.
The module will provide java actions that will encrypt your string. In the microflow that does the rest call, you can encrypt your string and store in a variable, and then use that variable in the rest call.
Here is a link to the module:
https://appstore.home.mendix.com/link/app/170/