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, bool ownedRef)

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

this
this(GChecksumType digestType, char[] 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.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

doref
alias doref = ref_
Undocumented in source.

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.

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(bool transferOwnership)

Get the main Gtk struct

getString
string getString()

Gets the HMAC as a hexadecimal string.

getStruct
void* getStruct()

the main Gtk struct as a void*

ref_
Hmac ref_()

Atomically increments the reference count of @hmac by one.

unref
void unref()

Atomically decrements the reference count of @hmac by one.

update
void update(char[] data)

Feeds @data into an existing #GHmac.

Static functions

computeHmacForBytes
string computeHmacForBytes(GChecksumType digestType, Bytes key, Bytes data)

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

computeHmacForData
string computeHmacForData(GChecksumType digestType, char[] key, char[] data)

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, char[] key, string str)

Computes the HMAC for a string.

Variables

gHmac
GHmac* gHmac;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta

Since

2.30