MobSecureStore.Native (mob_secure_store v0.1.0)

Copy Markdown View Source

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.