Documentation
¶
Overview ¶
Package securestore keeps small secrets (tokens, keys, passwords) in the platform's protected storage: the Keychain on iOS and macOS (generic passwords of the app, this device only, available after first unlock); on Android values encrypted with an AES key held in the Android Keystore, stored in the app's private SharedPreferences; the Credential Manager on Windows (generic credentials of the user, not roaming); and the Secret Service on Linux (GNOME Keyring, KWallet) through libsecret. Linux returns ErrUnsupported when libsecret-1 is not installed or no Secret Service is running (headless sessions).
securestore.SetString(a, "session", tok) tok, err := securestore.GetString(a, "session") // ErrNotFound if never set
Items survive app updates; on iOS Keychain items may survive uninstalling the app. Values are meant to be small (kilobytes). Calls are safe from any goroutine and do not need the main thread. They return ErrUnsupported where the backend has no secure store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnsupported = platform.ErrUnsupported ErrNotFound = platform.ErrNotFound )
Functions ¶
Types ¶
This section is empty.