无法从密钥库中删除别名 [英] Cannot Delete an alias from the KeyStore
问题描述
我在我的应用程序中使用密钥库
(java.security.KeyStore中)。结果
有迹象表明,我需要从密钥库中删除别名情景,我这样做与下面的行:
I am using a KeyStore
(java.security.KeyStore) in my application.
There are scenarios that I need to delete an alias from the keystore and I am doing that with the following line:
mKeystore.deleteEntry(化名);
mKeystore.deleteEntry(alias);
如果我以后有强制停止的应用程序,然后,当我再次启动该应用程序,我可以看到条目的不可以删除,并关闭仍然存在!如果我不强行停止,然后被删除(直至生效停止)。
If I close after that the application with 'Force Stop' then when I launch again the application I can see that the entry is not deleted and still exists! If I don't force stop, then it is deleted (until the force stop).
谁能弄清楚为什么我不能删除密钥库条目?
Can anyone figure why I can't delete an entry from the keystore?
推荐答案
要刷新更新的密钥库永久存储,你可能需要调用 mKeystore.store()
之后 mKeystore.deleteEntry(化名)
。
To flush the updated KeyStore to permanent storage, you probably need to call mKeystore.store()
after mKeystore.deleteEntry(alias)
.
这篇关于无法从密钥库中删除别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!