-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Library to access secure credential storage providers
--   
--   Cross-platform library for storing secrets.
--   
--   Uses Windows credential store, gnome-keyring or kwallet as backends.
@package credential-store
@version 0.1.2


-- | Cross-platform library to access system-specific credential store.
--   
--   Uses Windows CredRead/CredWrite/CredDelete API on Windows, DBus Secret
--   Store API with gnome-keyring or kwallet as backends on Unix. MacOS is
--   not supported yet.
--   
--   Example usage:
--   
--   <pre>
--   withCredentialStore $ \store -&gt; do
--       putCredential store credentialName credentialValue
--       v &lt;- getCredential store credentialName
--       deleteCredential store credentialName
--   </pre>
module System.CredentialStore

-- | Abstract context for credential store communications.
data CredentialStore

-- | Read named credential from store. Returns <a>Nothing</a> if credential
--   was not found.
getCredential :: ByteArray ba => CredentialStore -> String -> IO (Maybe ba)

-- | Write named credential to store, overwriting existing one.
putCredential :: ByteArray ba => CredentialStore -> String -> ba -> IO ()

-- | Delete named credential from store.
deleteCredential :: CredentialStore -> String -> IO ()

-- | Open credential store and execute function passing it as parameter.
--   Store is closed even in presence of exceptions.
withCredentialStore :: (CredentialStore -> IO a) -> IO a
