Stores, fetches, and deletes generic passwords in macOS Keychain, Linux Secret Service, and Windows Credential Manager.
The service is the Hush key. The account comes from the :account option, then
config :hush, Hush.Provider.OsKeychain, account: .... Writes default to the
account "hush"; reads and deletes without an account search by service alone.
See the README for installation, Hush setup, OS tools, lookup rules, and platform and security limitations.
Summary
Types
Functions
Deletes the item stored under service, resolved the same way as fetch/2.
Options
:account- the account of the item
Examples
HushOsKeychain.delete("myapp.db_password")
#=> :ok
Fetches the secret stored under service.
Without an account, exactly one item with that service must exist.
Options
:account- the account of the item
Examples
HushOsKeychain.fetch("myapp.db_password")
#=> {:ok, "s3cret"}
HushOsKeychain.fetch("myapp.db_password", account: "ygor")
#=> {:error, :not_found}
Formats an error returned by this module, naming the OS store and the service.
Examples
HushOsKeychain.format_error({:access_denied, "user canceled"}, "myapp.db_password")
#=> "macOS Keychain: access denied: user canceled (service \"myapp.db_password\")"
Stores secret under service, replacing an existing item for the same account.
The account falls back to "hush" when none is configured.
Options
:account- the account of the item
Examples
HushOsKeychain.put("myapp.db_password", "s3cret")
#=> :ok