Android 中的私钥存储

发布于 2024-12-05 10:03:48 字数 110 浏览 1 评论 0原文

我必须将我的应用程序的私钥存储在 Android 设备中的安全位置,我读到了有关 certStore 的信息,但它不允许在其中存储文件。 是否有任何位置可以安全地存储它,并且在重新安装应用程序时不会被删除。

I have to store the private key of my app in a secure location in the android device, i read about certStore, but it doesnt allow to store a file in it.
Is there any location where I can store it securely and doesn't get deleted if app re-installs.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱*していゐ 2024-12-12 10:03:48
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.

但这并不能保护密钥不被用户本身读取。

如果您想在删除应用程序并再次安装到设备后使用此共享首选项,请尝试使用 Android 备份管理器。
我认为它可以帮助您重新安装活动数据。

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.

谢谢。

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.

But this won't protect the key from being read by the user itself.

and if you want to use this shared preference after your application removed and again installed in device then try for Android Backup Manager.
I think its help you in re-installation of your activity's data.

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.

Thanks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文