Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.Secret.Structs.Value
Description
A secret value, like a password or other binary secret.
Synopsis
- newtype Value = Value (ManagedPtr Value)
- valueGet :: (HasCallStack, MonadIO m) => Value -> m ByteString
- valueGetContentType :: (HasCallStack, MonadIO m) => Value -> m Text
- valueGetText :: (HasCallStack, MonadIO m) => Value -> m (Maybe Text)
- valueNew :: (HasCallStack, MonadIO m) => Text -> Int64 -> Text -> m Value
- valueNewFull :: (HasCallStack, MonadIO m) => Text -> Int64 -> Text -> DestroyNotify -> m Value
- valueRef :: (HasCallStack, MonadIO m) => Value -> m Value
- valueUnref :: (HasCallStack, MonadIO m) => Value -> m ()
- valueUnrefToPassword :: (HasCallStack, MonadIO m) => Value -> Word64 -> m Text
Exported types
Memory-managed wrapper type.
Instances
Eq Value Source # | |
GBoxed Value Source # | |
Defined in GI.Secret.Structs.Value | |
ManagedPtrNewtype Value Source # | |
Defined in GI.Secret.Structs.Value Methods toManagedPtr :: Value -> ManagedPtr Value | |
TypedObject Value Source # | |
Defined in GI.Secret.Structs.Value | |
HasParentTypes Value Source # | |
Defined in GI.Secret.Structs.Value | |
IsGValue (Maybe Value) Source # | Convert |
Defined in GI.Secret.Structs.Value Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Value -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Value) | |
type ParentTypes Value Source # | |
Defined in GI.Secret.Structs.Value |
Methods
Click to display all available methods, including inherited ones
get
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> m ByteString | Returns: the secret data |
Get the secret data in the Value
. The value is not necessarily
null-terminated unless it was created with valueNew
or a
null-terminated string was passed to valueNewFull
.
getContentType
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> m Text | Returns: the content type |
Get the content type of the secret value, such as <literal>text/plain</literal>.
getText
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> m (Maybe Text) | Returns: the content type |
Get the secret data in the Value
if it contains a textual
value. The content type must be <literal>text/plain</literal>.
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int64 |
|
-> Text |
|
-> m Value | Returns: the new |
Create a Value
for the secret data passed in. The secret data is
copied into non-pageable 'secure' memory.
If the length is less than zero, then secret
is assumed to be
null-terminated.
newFull
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int64 |
|
-> Text |
|
-> DestroyNotify |
|
-> m Value | Returns: the new |
Create a Value
for the secret data passed in. The secret data is
not copied, and will later be freed with the destroy
function.
If the length is less than zero, then secret
is assumed to be
null-terminated.
ref
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> m Value | Returns: the value |
Add another reference to the Value
. For each reference
valueUnref
should be called to unreference the value.
unref
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> m () |
Unreference a Value
. When the last reference is gone, then
the value will be freed.
unrefToPassword
Arguments
:: (HasCallStack, MonadIO m) | |
=> Value |
|
-> Word64 |
|
-> m Text | Returns: a new password string stored in nonpageable memory
which must be freed with |