Using a personal certificate in an Android Application

拟墨画扇 提交于 2019-12-23 17:25:43

问题


I want users to be able to install their own personal certificate into my Android application after installation from a website which generates the certificates, but when I use a WebClient or the Android Browser to surf to it, the Secure Storage pops up and installs it, which is unavailable by API until version 14 (Android 4.0), which my users do not have installed.

An example of such a site is http://www.comodo.com/home/email-security/free-email-certificate.php . Here you can request a personal certificate, and after confirming, you get a link where you can download the certificate. I want users to be able to download certificates from this website, and others, into my application.

Can anyone tell me which intent to handle to be able to get the certificate into my own application, or how to modify WebClient such that it allows me to decide what it should do with the file?

Thanks in advance, Patrick


回答1:


Since the Android keystore API is not public before ICS (4.0), you need to save the key and certificate to some file your app can access to be able to use them. If you require a standard password-protected Java keystore file and require password input for crypto operations, it would be reasonably secure.

You can import a key/certificate pair in pre-ICS versions using Settings->Location and security->'Install from SD card', but there is no public API to access those from your app, the can only be used by the built-in VPN client.



来源:https://stackoverflow.com/questions/8202693/using-a-personal-certificate-in-an-android-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!