gi-secret-0.0.12: Libsecret bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Secret.Structs.Value

Description

A secret value, like a password or other binary secret.

Synopsis

Exported types

newtype Value Source #

Memory-managed wrapper type.

Constructors

Value (ManagedPtr Value) 

Instances

Instances details
Eq Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

(==) :: Value -> Value -> Bool

(/=) :: Value -> Value -> Bool

GBoxed Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

ManagedPtrNewtype Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

toManagedPtr :: Value -> ManagedPtr Value

TypedObject Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

glibType :: IO GType

IsGValue Value Source #

Convert Value to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Secret.Structs.Value

Methods

toGValue :: Value -> IO GValue

fromGValue :: GValue -> IO Value

HasParentTypes Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

type ParentTypes Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

type ParentTypes Value = '[] :: [Type]

Methods

Overloaded methods

get

valueGet Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: the 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

valueGetContentType Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: the value

-> m Text

Returns: the content type

Get the content type of the secret value, such as <literal>text/plain</literal>.

getText

valueGetText Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: the 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

valueNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

secret: the secret data

-> Int64

length: the length of the data

-> Text

contentType: the content type of the data

-> m Value

Returns: the new Value

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

valueNewFull Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

secret: the secret data

-> Int64

length: the length of the data

-> Text

contentType: the content type of the data

-> DestroyNotify

destroy: function to call to free the secret data

-> m Value

Returns: the new Value

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

valueRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: value to reference

-> m Value

Returns: the value

Add another reference to the Value. For each reference valueUnref should be called to unreference the value.

unref

valueUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: value to unreference

-> m () 

Unreference a Value. When the last reference is gone, then the value will be freed.

unrefToPassword

valueUnrefToPassword Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: the value

-> Word64

length: the length of the secret

-> m Text

Returns: a new password string stored in nonpageable memory which must be freed with secret_password_free() when done

Unreference a Value and steal the secret data in Value as nonpageable memory.

Since: 0.19.0