Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
- newtype Service = Service String
- newtype Username = Username String
- newtype Password = Password String
- getPassword :: Service -> Username -> IO (Maybe Password)
- setPassword :: Service -> Username -> Password -> IO ()
- data KeyringError = forall e . Exception e => KeyringError e
- data KeyringMissingBackendError = KeyringMissingBackendError
Data types
A service which uses the keyring
The service identifies the application or service for which a secret is stored.
Password storage
getPassword :: Service -> Username -> IO (Maybe Password) Source
gets the password for the given getPassword
service usernameusername
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
adds setPassword
service username passwordpassword
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.
forall e . Exception e => KeyringError e |
data KeyringMissingBackendError Source
KeyringMissingBackendError |
See System.Keyring for a list of supported keyring backends. |