[英]I want to use Android KeyChain to store public key and private key
I want to store private key in android KeyChain.我想将私钥存储在 android KeyChain 中。 I write code to store key already.
我已经编写代码来存储密钥。 But I don't understand when uninstall app and clear app key lost or not.
但我不明白卸载应用程序并清除应用程序密钥是否丢失。 I want to store key in KeyChain when clear app or uninstall key still have.
当清除应用程序或卸载密钥仍然存在时,我想将密钥存储在 KeyChain 中。
try {
Intent intent = KeyChain.createInstallIntent();
intent.putExtra("PKEY", privateKey);
intent.putExtra("KEY", publicKey);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return true;
} catch (ActivityNotFoundException e) {
Log.w("MainActivity", "could not store key pair: " + e);
}
How can I retrieve private key from KeyChain.createInstallIntent()?如何从 KeyChain.createInstallIntent() 中检索私钥?
Intent stores data for only for some limited time.If you want to store key value data permanently I suggest to use Json Api.You have to create json API using PHP & manage your data by calling APi when you need in your android App. Intent stores data for only for some limited time.If you want to store key value data permanently I suggest to use Json Api.You have to create json API using PHP & manage your data by calling APi when you need in your android App.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.