gi-secret
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Secret.Structs.Value

Description

A value containing a secret

A Value contains a password or other secret value.

Use [methodvalue.get] to get the actual secret data, such as a password. The secret data is not necessarily null-terminated, unless the content type is "text/plain".

Each Value has a content type. For passwords, this is text/plain. Use [methodvalue.get_content_type] to look at the content type.

Value is reference counted and immutable. The secret data is only freed when all references have been released via [methodvalue.unref].

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

TypedObject Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

glibType :: IO GType #

HasParentTypes Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

HasAttributeList Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

(info ~ ResolveValueMethod t Value, OverloadedMethod info Value p, HasField t Value p) => HasField (t :: Symbol) Value p Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

getField :: Value -> p #

(signature ~ m Text, MonadIO m) => OverloadedMethod ValueGetContentTypeMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

(signature ~ m ByteString, MonadIO m) => OverloadedMethod ValueGetMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

(signature ~ m (Maybe Text), MonadIO m) => OverloadedMethod ValueGetTextMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

(signature ~ m Value, MonadIO m) => OverloadedMethod ValueRefMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

(signature ~ m (), MonadIO m) => OverloadedMethod ValueUnrefMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

(signature ~ (CSize -> m (Text, CSize)), MonadIO m) => OverloadedMethod ValueUnrefToPasswordMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

OverloadedMethodInfo ValueGetContentTypeMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

OverloadedMethodInfo ValueGetMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

OverloadedMethodInfo ValueGetTextMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

OverloadedMethodInfo ValueRefMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

OverloadedMethodInfo ValueUnrefMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

OverloadedMethodInfo ValueUnrefToPasswordMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

(info ~ ResolveValueMethod t Value, OverloadedMethodInfo info Value) => IsLabel t (MethodProxy info Value) Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

fromLabel :: MethodProxy info Value #

(info ~ ResolveValueMethod t Value, OverloadedMethod info Value p) => IsLabel t (Value -> p) Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

fromLabel :: Value -> p #

IsGValue (Maybe Value) Source #

Convert Value to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Secret.Structs.Value

type AttributeList Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

type AttributeList Value
type ParentTypes Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

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

Methods

Click to display all available methods, including inherited ones

Expand

Methods

get, ref, unref, unrefToPassword.

Getters

getContentType, getText.

Setters

None.

get

data ValueGetMethodInfo Source #

Instances

Instances details
(signature ~ m ByteString, MonadIO m) => OverloadedMethod ValueGetMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

OverloadedMethodInfo ValueGetMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

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 [ctorvalue.new] or a null-terminated string was passed to [ctorvalue.new_full].

getContentType

data ValueGetContentTypeMethodInfo Source #

Instances

Instances details
(signature ~ m Text, MonadIO m) => OverloadedMethod ValueGetContentTypeMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

OverloadedMethodInfo ValueGetContentTypeMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

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 text/plain.

getText

data ValueGetTextMethodInfo Source #

Instances

Instances details
(signature ~ m (Maybe Text), MonadIO m) => OverloadedMethod ValueGetTextMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

OverloadedMethodInfo ValueGetTextMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

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 text/plain.

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

data ValueRefMethodInfo Source #

Instances

Instances details
(signature ~ m Value, MonadIO m) => OverloadedMethod ValueRefMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

OverloadedMethodInfo ValueRefMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

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 [methodvalue.unref] should be called to unreference the value.

unref

data ValueUnrefMethodInfo Source #

Instances

Instances details
(signature ~ m (), MonadIO m) => OverloadedMethod ValueUnrefMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

OverloadedMethodInfo ValueUnrefMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

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

data ValueUnrefToPasswordMethodInfo Source #

Instances

Instances details
(signature ~ (CSize -> m (Text, CSize)), MonadIO m) => OverloadedMethod ValueUnrefToPasswordMethodInfo Value signature Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethod :: Value -> signature

OverloadedMethodInfo ValueUnrefToPasswordMethodInfo Value Source # 
Instance details

Defined in GI.Secret.Structs.Value

Methods

overloadedMethodInfo :: Maybe ResolvedSymbolInfo

valueUnrefToPassword Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: the value

-> CSize

length: the length of the secret

-> m (Text, CSize)

Returns: a new password string stored in nonpageable memory which must be freed with [funcpasswordFree] when done

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

Since: 0.19.0