Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cross-platform library to access system-specific credential store.
Uses Windows CredReadCredWriteCredDelete API on Windows, DBus Secret Store API with gnome-keyring or kwallet as backends on Unix. MacOS is not supported yet.
Example usage:
withCredentialStore $ store -> do putCredential store credentialName credentialValue v <- getCredential store credentialName deleteCredential store credentialName
- data CredentialStore
- getCredential :: ByteArray ba => CredentialStore -> String -> IO (Maybe ba)
- putCredential :: ByteArray ba => CredentialStore -> String -> ba -> IO ()
- deleteCredential :: CredentialStore -> String -> IO ()
- withCredentialStore :: (CredentialStore -> IO a) -> IO a
Types
data CredentialStore Source #
Abstract context for credential store communications.
Functions
getCredential :: ByteArray ba => CredentialStore -> String -> IO (Maybe ba) Source #
Read named credential from store. Returns Nothing
if credential was not found.
putCredential :: ByteArray ba => CredentialStore -> String -> ba -> IO () Source #
Write named credential to store, overwriting existing one.
deleteCredential :: CredentialStore -> String -> IO () Source #
Delete named credential from store.
withCredentialStore :: (CredentialStore -> IO a) -> IO a Source #
Open credential store and execute function passing it as parameter. Store is closed even in presence of exceptions.