Interface SecretsStore
public interface SecretsStore
The pluggable backend behind Secrets. A platform port or cn1lib
registers a hardware-backed implementation (iOS Keychain Services, Android
Keystore / EncryptedSharedPreferences, Windows DPAPI, macOS Keychain) via
Secrets.setStore(SecretsStore) so secrets are protected by the
operating system's secure enclave. When none is registered, Secrets
falls back to DefaultSecretsStore (AES-encrypted at rest in
Storage), which is secure-by-default but software-only.
Implementations must treat keys and values as opaque UTF-8 strings and must never log or transmit plaintext values.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether a secret is stored underkey.voidRemove the secret stored underkey(no-op if absent).Return the secret stored underkey, ornullif absent.booleanWhether this store is backed by the device's hardware/OS keychain (true) rather than the software AES-at-rest fallback (false).keys()The keys of every stored secret (never the values).voidStore (or replace) the secretvalueunderkey.
-
Method Details
-
set
-
get
-
contains
Whether a secret is stored underkey. -
delete
Remove the secret stored underkey(no-op if absent). -
keys
-
isHardwareBacked
boolean isHardwareBacked()Whether this store is backed by the device's hardware/OS keychain (true) rather than the software AES-at-rest fallback (false). Lets an app decide whether to store especially sensitive material.
-