gi-glib-2.0.12: GLib bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GLib.Structs.Hmac

Contents

Description

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

Synopsis

Exported types

newtype Hmac #

Constructors

Hmac (ManagedPtr Hmac) 

Instances

WrappedPtr Hmac # 
((~) * info (ResolveHmacMethod t Hmac), MethodInfo * info Hmac p) => IsLabel t (Hmac -> p) # 

Methods

fromLabel :: Proxy# Symbol t -> Hmac -> p #

((~) * info (ResolveHmacMethod t Hmac), MethodInfo * info Hmac p) => IsLabelProxy t (Hmac -> p) # 

Methods

fromLabelProxy :: Proxy Symbol t -> Hmac -> p #

HasAttributeList * Hmac # 
((~) * signature (ByteString -> m ()), MonadIO m) => MethodInfo * HmacUpdateMethodInfo Hmac signature # 
((~) * signature (m ()), MonadIO m) => MethodInfo * HmacUnrefMethodInfo Hmac signature # 
((~) * signature (m Text), MonadIO m) => MethodInfo * HmacGetStringMethodInfo Hmac signature # 
((~) * signature (Word8 -> Word64 -> m ()), MonadIO m) => MethodInfo * HmacGetDigestMethodInfo Hmac signature # 
type AttributeList Hmac # 

Methods

getDigest

data HmacGetDigestMethodInfo #

Instances

((~) * signature (Word8 -> Word64 -> m ()), MonadIO m) => MethodInfo * HmacGetDigestMethodInfo Hmac signature # 

hmacGetDigest #

Arguments

:: (HasCallStack, MonadIO m) 
=> Hmac

hmac: a Hmac

-> Word8

buffer: output buffer

-> Word64

digestLen: an inout parameter. The caller initializes it to the size of buffer. After the call it contains the length of the digest

-> m () 

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.

Once this function has been called, the Hmac is closed and can no longer be updated with checksumUpdate.

Since: 2.30

getString

data HmacGetStringMethodInfo #

Instances

((~) * signature (m Text), MonadIO m) => MethodInfo * HmacGetStringMethodInfo Hmac signature # 

hmacGetString #

Arguments

:: (HasCallStack, MonadIO m) 
=> Hmac

hmac: a Hmac

-> m Text

Returns: the hexadecimal representation of the HMAC. The returned string is owned by the HMAC and should not be modified or freed.

Gets the HMAC as an hexadecimal string.

Once this function has been called the Hmac can no longer be updated with hmacUpdate.

The hexadecimal characters will be lower case.

Since: 2.30

unref

data HmacUnrefMethodInfo #

Instances

((~) * signature (m ()), MonadIO m) => MethodInfo * HmacUnrefMethodInfo Hmac signature # 

hmacUnref #

Arguments

:: (HasCallStack, MonadIO m) 
=> Hmac

hmac: a Hmac

-> m () 

Atomically decrements the reference count of hmac by one.

If the reference count drops to 0, all keys and values will be destroyed, and all memory allocated by the hash table is released. This function is MT-safe and may be called from any thread. Frees the memory allocated for hmac.

Since: 2.30

update

data HmacUpdateMethodInfo #

Instances

((~) * signature (ByteString -> m ()), MonadIO m) => MethodInfo * HmacUpdateMethodInfo Hmac signature # 

hmacUpdate #

Arguments

:: (HasCallStack, MonadIO m) 
=> Hmac

hmac: a Hmac

-> ByteString

data: buffer used to compute the checksum

-> m () 

Feeds data into an existing Hmac.

The HMAC must still be open, that is hmacGetString or hmacGetDigest must not have been called on hmac.

Since: 2.30