如何从我的 Android 应用程序访问用户安装的密钥和证书?
我一直在努力从 SD 卡上的 p12 文件中使用用户安装的身份 CA 证书。证书和密钥使用安全凭证存储(位置和安全性 > 从 SD 卡安装)进行安装。
我没有找到任何说明密钥和证书导入后的位置的文档。我尝试创建 TrustManagerFactory 的实例,但没有成功,它只包含所有预安装的 SSL 证书。
使用默认参数创建密钥库似乎也不起作用。任何建议将不胜感激!
I've been struggling to consume user installed identity CA certs from a p12 file on an SD card. The certs and keys are installed using the Secure Credential Storage (Location & Security > Install from SD card).
I haven't found any documentation stating the location if the keys and certificates once imported. I tried to create an instance of a TrustManagerFactory with no luck, it just contained all the pre-installed SSL certificates.
Creating an KeyStore with the default parameters doesn't seem to work either. Any suggestions would be much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 JavaMail Crypto 和 充气城堡组合。
它们允许您使用文件输入流导入 p12 文件,并让您相应地处理它。
设置起来可能很棘手,如果您感到沮丧,可以使用 Chilkat 专为 android 开发,我可以确认它工作得很好。
Take a look at the JavaMail Crypto and Bouncy Castle combo.
They allow you to import the p12 file using a file input stream and let you deal with it accordingly.
It can be tricky to get set up and if you get frustrated, there is a 30 day free trial with Chilkat developed specifically for android which I can confirm works perfectly.