Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
An opaque structure representing a HMAC operation.
To create a new GHmac, use g_hmac_new()
. To free
a GHmac, use hmacUnref
.
- newtype Hmac = Hmac (ManagedPtr Hmac)
- noHmac :: Maybe Hmac
- data HmacGetDigestMethodInfo
- hmacGetDigest :: (HasCallStack, MonadIO m) => Hmac -> Word8 -> Word64 -> m ()
- data HmacGetStringMethodInfo
- hmacGetString :: (HasCallStack, MonadIO m) => Hmac -> m Text
- data HmacUnrefMethodInfo
- hmacUnref :: (HasCallStack, MonadIO m) => Hmac -> m ()
- data HmacUpdateMethodInfo
- hmacUpdate :: (HasCallStack, MonadIO m) => Hmac -> ByteString -> m ()
Exported types
WrappedPtr Hmac Source # | |
((~) * info (ResolveHmacMethod t Hmac), MethodInfo * info Hmac p) => IsLabel t (Hmac -> p) Source # | |
((~) * info (ResolveHmacMethod t Hmac), MethodInfo * info Hmac p) => IsLabelProxy t (Hmac -> p) Source # | |
HasAttributeList * Hmac Source # | |
((~) * signature (ByteString -> m ()), MonadIO m) => MethodInfo * HmacUpdateMethodInfo Hmac signature Source # | |
((~) * signature (m ()), MonadIO m) => MethodInfo * HmacUnrefMethodInfo Hmac signature Source # | |
((~) * signature (m Text), MonadIO m) => MethodInfo * HmacGetStringMethodInfo Hmac signature Source # | |
((~) * signature (Word8 -> Word64 -> m ()), MonadIO m) => MethodInfo * HmacGetDigestMethodInfo Hmac signature Source # | |
type AttributeList Hmac Source # | |
Methods
getDigest
data HmacGetDigestMethodInfo Source #
((~) * signature (Word8 -> Word64 -> m ()), MonadIO m) => MethodInfo * HmacGetDigestMethodInfo Hmac signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Hmac |
|
-> Word8 |
|
-> Word64 |
|
-> 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 Source #
((~) * signature (m Text), MonadIO m) => MethodInfo * HmacGetStringMethodInfo Hmac signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> 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 Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * HmacUnrefMethodInfo Hmac signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> 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 Source #
((~) * signature (ByteString -> m ()), MonadIO m) => MethodInfo * HmacUpdateMethodInfo Hmac signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Hmac |
|
-> ByteString |
|
-> 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