如何从我的 Android 应用程序访问用户安装的密钥和证书?

发布于 2024-09-13 02:08:42 字数 210 浏览 2 评论 0原文

我一直在努力从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遥远的绿洲 2024-09-20 02:08:42

查看 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文