diff options
-rw-r--r-- | api/current.txt | 5 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiEnterpriseConfig.java | 34 |
2 files changed, 37 insertions, 2 deletions
diff --git a/api/current.txt b/api/current.txt index 734fee9..eeeac66 100644 --- a/api/current.txt +++ b/api/current.txt @@ -13931,8 +13931,11 @@ package android.net.wifi { ctor public WifiEnterpriseConfig(android.net.wifi.WifiEnterpriseConfig); method public int describeContents(); method public java.lang.String getAnonymousIdentity(); + method public java.security.cert.X509Certificate getCaCertificate(); + method public java.security.cert.X509Certificate getClientCertificate(); method public int getEapMethod(); method public java.lang.String getIdentity(); + method public java.lang.String getPassword(); method public int getPhase2Method(); method public java.lang.String getSubjectMatch(); method public void setAnonymousIdentity(java.lang.String); @@ -13948,7 +13951,6 @@ package android.net.wifi { } public static final class WifiEnterpriseConfig.Eap { - ctor public WifiEnterpriseConfig.Eap(); field public static final int NONE = -1; // 0xffffffff field public static final int PEAP = 0; // 0x0 field public static final int PWD = 3; // 0x3 @@ -13957,7 +13959,6 @@ package android.net.wifi { } public static final class WifiEnterpriseConfig.Phase2 { - ctor public WifiEnterpriseConfig.Phase2(); field public static final int GTC = 4; // 0x4 field public static final int MSCHAP = 2; // 0x2 field public static final int MSCHAPV2 = 3; // 0x3 diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java index 4e7497c..e2512a4 100644 --- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java +++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java @@ -223,6 +223,9 @@ public class WifiEnterpriseConfig implements Parcelable { public static final int PWD = 3; /** @hide */ public static final String[] strings = { "PEAP", "TLS", "TTLS", "PWD" }; + + /** Prevent initialization */ + private Eap() {} } /** The inner authentication method used */ @@ -239,6 +242,9 @@ public class WifiEnterpriseConfig implements Parcelable { private static final String PREFIX = "auth="; /** @hide */ public static final String[] strings = {EMPTY_VALUE, "PAP", "MSCHAP", "MSCHAPV2", "GTC" }; + + /** Prevent initialization */ + private Phase2() {} } /** Internal use only */ @@ -363,6 +369,16 @@ public class WifiEnterpriseConfig implements Parcelable { } /** + * Get the password. + * + * Returns locally set password value. For networks fetched from + * framework, returns "*". + */ + public String getPassword() { + return getFieldValue(PASSWORD_KEY, ""); + } + + /** * Set CA certificate alias. * * <p> See the {@link android.security.KeyChain} for details on installing or choosing @@ -404,6 +420,15 @@ public class WifiEnterpriseConfig implements Parcelable { } /** + * Get CA certificate + * + * @return X.509 CA certificate + */ + public X509Certificate getCaCertificate() { + return mCaCert; + } + + /** * Set Client certificate alias. * * <p> See the {@link android.security.KeyChain} for details on installing or choosing @@ -463,6 +488,15 @@ public class WifiEnterpriseConfig implements Parcelable { mClientCertificate = clientCertificate; } + /** + * Get client certificate + * + * @return X.509 client certificate + */ + public X509Certificate getClientCertificate() { + return mClientCertificate; + } + boolean needsKeyStore() { // Has no keys to be installed if (mClientCertificate == null && mCaCert == null) return false; |