-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Keyring access
--
-- keyring provides access to the system's keyring to securely store
-- passwords.
--
-- Currently this library supports the following keyring implementations:
--
--
-- - Keychain on OS X
-- - KWallet on KDE
--
--
-- The System.Keyring module provides the high-level functions
-- getPassword and setPassword to easily get and set
-- passwords in the keyring of the current user. The appropriate backend
-- is chosen automatically.
@package keyring
@version 0.1.0.2
-- | Access to KWallet.
module System.Keyring.Unix.KDE
-- | getPassword service username gets a password from the
-- user's network wallet.
--
-- username is the name of the user whose password to get.
-- service identifies the application which fetches the
-- password.
--
-- This function throws KWalletError if access to KWallet failed.
getPassword :: Service -> Username -> IO (Maybe Password)
-- | setPassword service username password adds
-- password for username to the user's network wallet.
--
-- username is the name of the user whose password to set.
-- service identifies the application which sets the password.
--
-- This function throws KWalletError if access to KWallet failed.
setPassword :: Service -> Username -> Password -> IO ()
data KWalletError
-- | KWalletDBusError name message denotes an error
-- received over DBus.
--
-- name is the proper name of the error, and message is
-- a human-readable error message.
KWalletDBusError :: ErrorName -> (Maybe String) -> KWalletError
-- | KWalletOperationError message denotes a failed KWallet
-- operation.
--
-- message is a human-readable error message with details on the
-- error.
KWalletOperationError :: String -> KWalletError
-- | KWalletInvalidReturn expected actual denotes an
-- unexpected return value from a DBus method call.
--
-- expected is the expected type signature, and actual
-- is the signature which was actually received from the remote DBus
-- object.
KWalletInvalidReturn :: [Type] -> [Type] -> KWalletError
instance Typeable KWalletError
instance DBusTypeable Wallet
instance DBusTypeable AppID
instance Exception KWalletError
instance Show KWalletError
-- | Access to keyrings of Unix systems.
--
-- Currently this module only supports KWallet, via
-- System.Keyring.Unix.KDE.
--
-- This module and any of its submodules are not available on OS X. See
-- System.Keyring.Darwin for keyring support on OS X.
module System.Keyring.Unix
-- | getPassword service username gets a password from the
-- current keyring.
--
-- username is the name of the user whose password to get.
-- service identifies the application which fetches 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.
getPassword :: Service -> Username -> IO (Maybe Password)
-- | setPassword service username password adds
-- password for username to the current keyring.
--
-- username is the name of the user whose password to set.
-- 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.
setPassword :: Service -> Username -> Password -> IO ()
-- | 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.
module System.Keyring
-- | A service which uses the keyring
--
-- The service identifies the application or service for which a secret
-- is stored.
newtype Service
Service :: String -> Service
-- | A username
newtype Username
Username :: String -> Username
-- | A password
newtype Password
Password :: String -> Password
-- | 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.
getPassword :: Service -> Username -> IO (Maybe Password)
-- | 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.
setPassword :: Service -> Username -> Password -> IO ()
-- | Base type for all exceptions of this library.
data KeyringError
KeyringError :: e -> KeyringError
data 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.
KeyringMissingBackendError :: KeyringMissingBackendError