# `MobSecureStore.Native`
[🔗](https://github.com/GenericJam/mob_secure_store/blob/main/lib/mob_secure_store/native.ex#L1)

The phone's backend: the `:mob_secure_store_nif` NIF, linked into the app by
the native build. EncryptedSharedPreferences under an Android Keystore
master key on Android, the Keychain on iOS.

Errors on iOS are `{:error, {:sec, os_status}}` from Security.framework, or
`{:error, :no_data}` when the Keychain reported success without returning
the value. On Android they are `{:error, {:jni, reason}}`, where reason is
`:no_jenv`, `:bridge_not_registered` (the bridge's `register()` didn't run
before the BEAM started), `:too_large` (over 2 GiB), `:alloc`,
`:call_failed` (the bridge threw, e.g. the encrypted preferences couldn't
be opened; it logs why under the `MobSecureStore` logcat tag) or
`:commit_failed`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
