Portability | non-portable (FFI) |
---|---|
Stability | experimental |
Maintainer | John Millikin <jmillikin@gmail.com> |
GNOME Keyring manages multiple keyrings. Each keyring can store one or more items, containing secrets.
One of the keyrings is the default keyring, which can in many cases be
used by specifying Nothing
for a keyring names.
Each keyring can be in a locked or unlocked state. A password must be specified, either by the user or the calling application, to unlock the keyring.
- type KeyringName = Text
- getDefaultKeyring :: Operation (Maybe KeyringName)
- setDefaultKeyring :: KeyringName -> Operation ()
- listKeyringNames :: Operation [KeyringName]
- create :: KeyringName -> Maybe Text -> Operation ()
- delete :: KeyringName -> Operation ()
- changePassword :: KeyringName -> Maybe Text -> Maybe Text -> Operation ()
- listItemIDs :: Maybe KeyringName -> Operation [ItemID]
- lock :: Maybe KeyringName -> Operation ()
- lockAll :: Operation ()
- unlock :: Maybe KeyringName -> Maybe Text -> Operation ()
- data KeyringInfo = KeyringInfo {}
- data KeyringInfoToken
- getInfo :: Maybe KeyringName -> Operation KeyringInfo
- setInfo :: Maybe KeyringName -> KeyringInfo -> Operation ()
Documentation
type KeyringName = TextSource
Basic operations
getDefaultKeyring :: Operation (Maybe KeyringName)Source
Get the default keyring name. If no default keyring exists, then
Nothing
will be returned.
setDefaultKeyring :: KeyringName -> Operation ()Source
Change the default keyring.
listKeyringNames :: Operation [KeyringName]Source
Get a list of keyring names. If no keyrings exist, an empty list will be returned.
create :: KeyringName -> Maybe Text -> Operation ()Source
Create a new keyring with the specified name. In most cases, Nothing
will be passed as the password, which will prompt the user to enter a
password of their choice.
delete :: KeyringName -> Operation ()Source
Delete a keyring. Once a keyring is deleted, there is no mechanism for recovery of its contents.
Change the password for a keyring. In most cases, Nothing
would
be specified for both the original and new passwords to allow the user
to type both.
listItemIDs :: Maybe KeyringName -> Operation [ItemID]Source
Get a list of all the IDs for items in the keyring. All items which are
not flagged as ItemApplicationSecret
are included in the list. This
includes items that the calling application may not (yet) have access to.
Locking and unlocking
lock :: Maybe KeyringName -> Operation ()Source
Lock a keyring, so that its contents may not be accessed without first supplying a password.
Most keyring operations involving items require that the keyring first be
unlocked. One exception is findItems
and related computations.
Lock all the keyrings, so that their contents may not be accessed without first unlocking them with a password.
unlock :: Maybe KeyringName -> Maybe Text -> Operation ()Source
Unlock a keyring, so that its contents may be accessed. In most cases,
Nothing
will be specified as the password, which will prompt the user
to enter the correct password.
Most keyring operations involving items require that the keyring first be
unlocked. One exception is findItems
and related computations.
Keyring information
data KeyringInfoToken Source
getInfo :: Maybe KeyringName -> Operation KeyringInfoSource
Get information about the keyring.
setInfo :: Maybe KeyringName -> KeyringInfo -> Operation ()Source
Set flags and info for the keyring. The only fields in the
KeyringInfo
which are used are keyringLockOnIdle
and
keyringLockTimeout
.