summaryrefslogtreecommitdiffstats
path: root/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2013-02-07 15:09:22 -0800
committerIrfan Sheriff <isheriff@google.com>2013-02-13 10:32:58 -0800
commitfdc028383a01eaaa9bf93cb5d3ce50bd744eab52 (patch)
tree4fc660274fe4de378330b3299d9d6785f91fad5e /wifi/java/android/net/wifi/WifiEnterpriseConfig.java
parented0ea76cf4caf9b9e4528e776101739f4409a9a7 (diff)
downloadframeworks_base-fdc028383a01eaaa9bf93cb5d3ce50bd744eab52.zip
frameworks_base-fdc028383a01eaaa9bf93cb5d3ce50bd744eab52.tar.gz
frameworks_base-fdc028383a01eaaa9bf93cb5d3ce50bd744eab52.tar.bz2
Expose EAP config API
This API allows apps to setup access to enterprise Wi-Fi networks. Change-Id: I37573d76b8bd9cad72413afdc4fc62ce57b4dc43
Diffstat (limited to 'wifi/java/android/net/wifi/WifiEnterpriseConfig.java')
-rw-r--r--wifi/java/android/net/wifi/WifiEnterpriseConfig.java30
1 files changed, 26 insertions, 4 deletions
diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
index 7313e7e..95ffb1c 100644
--- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
+++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
@@ -42,7 +42,10 @@ import java.security.spec.PKCS8EncodedKeySpec;
import java.util.HashMap;
import java.util.Map;
-/** Enterprise configuration details for Wi-Fi @hide */
+/**
+ * Enterprise configuration details for Wi-Fi. Stores details about the EAP method
+ * and any associated credentials.
+ */
public class WifiEnterpriseConfig implements Parcelable {
private static final String TAG = "WifiEnterpriseConfig";
/**
@@ -211,22 +214,32 @@ public class WifiEnterpriseConfig implements Parcelable {
}
};
+ /** The Extensible Authentication Protocol method used */
public static final class Eap {
- /* NONE represents an empty enterprise config */
+ /** No EAP method used. Represents an empty config */
public static final int NONE = -1;
+ /** Protected EAP */
public static final int PEAP = 0;
+ /** EAP-Transport Layer Security */
public static final int TLS = 1;
+ /** EAP-Tunneled Transport Layer Security */
public static final int TTLS = 2;
+ /** EAP-Password */
public static final int PWD = 3;
/** @hide */
public static final String[] strings = { "PEAP", "TLS", "TTLS", "PWD" };
}
+ /** The inner authentication method used */
public static final class Phase2 {
public static final int NONE = 0;
+ /** Password Authentication Protocol */
public static final int PAP = 1;
+ /** Microsoft Challenge Handshake Authentication Protocol */
public static final int MSCHAP = 2;
+ /** Microsoft Challenge Handshake Authentication Protocol v2 */
public static final int MSCHAPV2 = 3;
+ /** Generic Token Card */
public static final int GTC = 4;
private static final String PREFIX = "auth=";
/** @hide */
@@ -249,6 +262,7 @@ public class WifiEnterpriseConfig implements Parcelable {
* Set the EAP authentication method.
* @param eapMethod is one {@link Eap#PEAP}, {@link Eap#TLS}, {@link Eap#TTLS} or
* {@link Eap#PWD}
+ * @throws IllegalArgumentException on an invalid eap method
*/
public void setEapMethod(int eapMethod) {
switch (eapMethod) {
@@ -279,6 +293,7 @@ public class WifiEnterpriseConfig implements Parcelable {
* @param phase2Method is the inner authentication method and can be one of {@link Phase2#NONE},
* {@link Phase2#PAP}, {@link Phase2#MSCHAP}, {@link Phase2#MSCHAPV2},
* {@link Phase2#GTC}
+ * @throws IllegalArgumentException on an invalid phase2 method
*
*/
public void setPhase2Method(int phase2Method) {
@@ -378,7 +393,10 @@ public class WifiEnterpriseConfig implements Parcelable {
* Specify a X.509 certificate that identifies the server.
*
* <p>A default name is automatically assigned to the certificate and used
- * with this configuration.
+ * with this configuration. The framework takes care of installing the
+ * certificate when the config is saved and removing the certificate when
+ * the config is removed.
+ *
* @param cert X.509 CA certificate
* @throws IllegalArgumentException if not a CA certificate
*/
@@ -425,9 +443,13 @@ public class WifiEnterpriseConfig implements Parcelable {
* Specify a private key and client certificate for client authorization.
*
* <p>A default name is automatically assigned to the key entry and used
- * with this configuration.
+ * with this configuration. The framework takes care of installing the
+ * key entry when the config is saved and removing the key entry when
+ * the config is removed.
+
* @param privateKey
* @param clientCertificate
+ * @throws IllegalArgumentException for an invalid key or certificate.
*/
public void setClientKeyEntry(PrivateKey privateKey, X509Certificate clientCertificate) {
if (clientCertificate != null) {