azure_core::hmac

Function hmac_sha256

source
pub fn hmac_sha256(data: &str, key: &Secret) -> Result<String>
Expand description

Tries to create an HMAC SHA256 signature from the given data and key. The key is expected to be a base64 encoded string and will be decoded before using it for signing. The returned signature is also base64 encoded.

If both hmac_rust and hmac_openssl are enabled, use hmac_openssl.

ยงErrors

  • If the key is not a valid base64 encoded string.
  • If it fails to create the HMAC from the key.