【问题标题】:Android WPA/8021X self signed certAndroid WPA/8021X 自签名证书
【发布时间】:2011-03-28 11:23:05
【问题描述】:
我正在编写一个应用程序,允许用户使用 PEAP 或 TTLS 和证书轻松地将 android 连接到企业无线网络。
我可以添加一个基于 EAP 的 wifi 配置文件并让它使用正确的凭据和证书将 wpa_supplicant 连接到网络。部分感谢here
但事实证明,安装证书很困难。
目前我正在应用程序中使用 WebVeiw 安装证书,以打开一个带有适当标题和证书的 php 文件。请参阅x509 header。这会打开一个 certManager 实例,该实例需要用户名 cert。
有没有更简洁的方法在 android 上安装 CA 证书?
从我目前的搜索来看,我猜不是。
【问题讨论】:
标签:
android
wifi
x509certificate
【解决方案1】:
好的,因为我发布了这个 Ice Cream Sandwich 4.x 已经在 KeyStore API 中提供了一个解决方案:
enter code here
Certificate cert = null;
//some code to get the cert
Intent intent = new Intent("android.credentials.INSTALL");
intent.putExtra("name", "Swansea Uni WiFi Cert");
try {
intent.putExtra("CERT",cert.getEncoded());
}
catch (CertificateEncodingException e)
{
e.printStackTrace();
SU1X.debug("error on cert install");
}
startActivityForResult(intent,0);
以为我会更新这个,以防其他人尝试做同样的事情并发现这个问题。