android - Android 中的私钥存储

标签 android certificate private-key

我必须将我的应用程序的私钥存储在 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/

相关文章:

powershell - 在 PowerShell 中通过 "Certificate Template Name"识别证书

python - 非对称加密 - 明文大小错误

javascript - 将 json 对象从 android(java) 传递到 Webview 中的 javascript

Android,更改应用程序 :theme value of SwitchCompat programmatically

java - Java 编译器会优化对最终静态变量的方法调用吗?当它变成 dalvik 代码时会发生什么?

node.js - ACME - 使用 SAN 获取子域证书

android - 如何决定我需要使用哪个 Android API 级别和 SDK 版本?

Java SSL 通信

php - ssh2_auth_pubkey_file 认证总是失败

mysql - 如何使用 Mysql 存储过程将导出的文件放置在安全文件传输协议(protocol) (SFTP) 位置