文档说:
The information stored in a ProtectionParameter object protects the contents of a keystore. For example, protection parameters may be used to check the integrity of keystore data, or to protect the confidentiality of sensitive keystore data (such as a PrivateKey).
但每个示例都只是传递 null
可以使用此参数的地方:
keystore.load(null);// here
KeyStore.Entry entry = keystore.getEntry(alias, null);//and here
请提供任何带有非空 参数的示例(例如真正执行某些操作的已实现接口(interface))?目前唯一的可能性是PasswordProtection或者有自定义实现?也许有一些解释为什么它在所有文档中都不重要以及何时可能变得重要?你的建议真的很有值(value)。谢谢。
最佳答案
其实KeyStore Documentation里面有一个非空的例子使用 KeyStore.PasswordProtection .
另一个“实现”(这只是一个标记接口(interface))是KeyProtection ,除了其他示异常(exception),您还可以在其中找到对其用途的解释:
Specification of how a key or key pair is secured when imported into the Android Keystore system. This class specifies authorized uses of the imported key, such as whether user authentication is required for using the key, what operations the key is authorized for (e.g., decryption, but not signing) with what parameters (e.g., only with a particular padding scheme or digest), and the key's validity start and end dates.
关于Android Keystore LoadStore 和 ProtectionParameter 实现实例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37905482/