keyring-0.1.0.4: Keyring access

Safe HaskellNone
LanguageHaskell2010

System.Keyring

Contents

Description

Access to the keyring of the user.

This module provides access to the keyring of the current system. Currently this module supports the following keyrings:

  • Keychain on OS X
  • KWallet on KDE

The module automatically picks the best appropriate keyring.

Synopsis

Data types

newtype Service Source

A service which uses the keyring

The service identifies the application or service for which a secret is stored.

Constructors

Service String 

newtype Username Source

A username

Constructors

Username String 

newtype Password Source

A password

Constructors

Password String 

Password storage

getPassword :: Service -> Username -> IO (Maybe Password) Source

getPassword service username gets the password for the given username and service from the keyring.

service identifies the application which gets the password.

This function throws KeyringMissingBackendError is no keyring implementation exists for the current system and environment, and KeyringError if access to the keyring failed.

setPassword :: Service -> Username -> Password -> IO () Source

setPassword service username password adds password to the keyring.

service identifies the application which sets the password.

This function throws KeyringMissingBackendError is no keyring implementation exists for the current system and environment, and KeyringError if access to the keyring failed.

Exceptions

data KeyringError Source

Base type for all exceptions of this library.

Constructors

forall e . Exception e => KeyringError e 

data KeyringMissingBackendError Source

Constructors

KeyringMissingBackendError

KeyringMissingBackendError indicates that no keyring backend is available for the current system and environment.

See System.Keyring for a list of supported keyring backends.