Function

GLibcompute_hmac_for_string

Declaration [src]

gchar*
g_compute_hmac_for_string (
  GChecksumType digest_type,
  const guchar* key,
  gsize key_len,
  const gchar* str,
  gssize length
)

Description [src]

Computes the HMAC for a string.

The hexadecimal string returned will be in lower case.

Available since:2.30

Parameters

digest_type GChecksumType
 

A GChecksumType to use for the HMAC.

key An array of guchar
 

The key to use in the HMAC.

 The length of the array is specified in the key_len argument.
 The data is owned by the caller of the function.
key_len gsize
 

The length of the key.

str const gchar*
 

The string to compute the HMAC for.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
length gssize
 

The length of the string, or -1 if the string is nul-terminated.

Return value

Returns: gchar*
 

The HMAC as a hexadecimal string. The returned string should be freed with g_free() when done using it.

 The caller of the function takes ownership of the data, and is responsible for freeing it.
 The string is a NUL terminated UTF-8 string.