我必须将我的应用程序的私钥存储在 Android 设备的安全位置,我阅读了有关 certStore 的信息,但它不允许在其中存储文件。 有没有我可以安全存储它并且在重新安装应用程序时不会被删除的位置。
最佳答案
You can store the key in the Preferences of your App. This will protect the key from
getting read by other applications because of the underlying file system restrictions of
the Android system.
但这并不能保护 key 不被用户自己读取。
如果您想在应用程序删除并再次安装到设备后使用此共享首选项,请尝试使用 Android 备份管理器。 我认为它可以帮助您重新安装 Activity 数据。
EDIT: Android (unfortunately) does not provide a way to do so. The approach I've used
before is to encrypt this token with another key generated within the app.
Your app key can be algorithmically generated. This, however, is only as secure as
your algorithm. Once that is known this is equivalent to storing the token in plain text.
谢谢。
关于android - Android 中的私钥存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7441915/