Hmac

An opaque structure representing a HMAC operation. To create a new GHmac, use g_hmac_new(). To free a GHmac, use g_hmac_unref().

Constructors

this
this(GHmac* gHmac)

Sets our main struct and passes it to the parent class.

this
this(GChecksumType digestType, string key)

Creates a new #GHmac, using the digest algorithm @digest_type. If the @digest_type is not known, %NULL is returned. A #GHmac can be used to compute the HMAC of a key and an arbitrary binary blob, using different hashing algorithms.

Members

Functions

copy
Hmac copy()

Copies a #GHmac. If @hmac has been closed, by calling g_hmac_get_string() or g_hmac_get_digest(), the copied HMAC will be closed as well.

doref
Hmac doref()

Atomically increments the reference count of @hmac by one.

getDigest
void getDigest(ubyte[] buffer)

Gets the digest from checksum as a raw binary array and places it into buffer. The size of the digest depends on the type of checksum.

getHmacStruct
GHmac* getHmacStruct()

Get the main Gtk struct

getString
string getString()

Gets the HMAC as an hexadecimal string.

getStruct
void* getStruct()

the main Gtk struct as a void*

unref
void unref()

Atomically decrements the reference count of @hmac by one.

update
void update(string data)

Feeds @data into an existing #GHmac.

Static functions

computeHmacForData
string computeHmacForData(GChecksumType digestType, string key, string data, size_t length)

Computes the HMAC for a binary @data of @length. This is a convenience wrapper for g_hmac_new(), g_hmac_get_string() and g_hmac_unref().

computeHmacForString
string computeHmacForString(GChecksumType digestType, string key, string str, ptrdiff_t length)

Computes the HMAC for a string.

Variables

gHmac
GHmac* gHmac;

the main Gtk struct

Meta

Since

2.30