Hmac

An opaque structure representing a HMAC operation. To create a new GHmac, use Hmac.new. To free a GHmac, use 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 glib.Hmac, using the digest algorithm digest_type. If the digest_type is not known, NULL is returned. A glib.Hmac can be used to compute the HMAC of a key and an arbitrary binary blob, using different hashing algorithms.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

copy
Hmac copy()

Copies a glib.Hmac If hmac has been closed, by calling Hmac.getString or Hmac.getDigest, 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 glib.Hmac

Static functions

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

Computes the HMAC for a binary data. This is a convenience wrapper for Hmac.new, Hmac.getString and 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 Hmac.new, Hmac.getString and 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

Meta

Since

2.30