Android APIs
public class

WifiEnterpriseConfig

extends Object
implements Parcelable
java.lang.Object
   ↳ android.net.wifi.WifiEnterpriseConfig

Class Overview

Enterprise configuration details for Wi-Fi. Stores details about the EAP method and any associated credentials.

Summary

Nested Classes
class WifiEnterpriseConfig.Eap The Extensible Authentication Protocol method used  
class WifiEnterpriseConfig.Phase2 The inner authentication method used  
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<WifiEnterpriseConfig> CREATOR
Public Constructors
WifiEnterpriseConfig()
WifiEnterpriseConfig(WifiEnterpriseConfig source)
Copy constructor
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
String getAltSubjectMatch()
Get alternate subject match
String getAnonymousIdentity()
Get the anonymous identity
X509Certificate getCaCertificate()
Get CA certificate
X509Certificate getClientCertificate()
Get client certificate
String getDomainSuffixMatch()
Get the domain_suffix_match value.
int getEapMethod()
Get the eap method.
String getIdentity()
Get the identity
String getPassword()
Get the password.
int getPhase2Method()
Get the phase 2 authentication method.
String getPlmn()
Get plmn (Public Land Mobile Network) for passpoint credential; see (String) for more information
String getRealm()
Get realm for passpoint credential; see setRealm(String) for more information
String getSubjectMatch()
This method was deprecated in API level 23. in favor of altSubjectMatch
void setAltSubjectMatch(String altSubjectMatch)
Set alternate subject match.
void setAnonymousIdentity(String anonymousIdentity)
Set anonymous identity.
void setCaCertificate(X509Certificate cert)
Specify a X.509 certificate that identifies the server.
void setClientKeyEntry(PrivateKey privateKey, X509Certificate clientCertificate)
Specify a private key and client certificate for client authorization.
void setDomainSuffixMatch(String domain)
Set the domain_suffix_match directive on wpa_supplicant.
void setEapMethod(int eapMethod)
Set the EAP authentication method.
void setIdentity(String identity)
Set the identity
void setPassword(String password)
Set the password.
void setPhase2Method(int phase2Method)
Set Phase 2 authentication method.
void setPlmn(String plmn)
Set plmn (Public Land Mobile Network) of the provider of passpoint credential
void setRealm(String realm)
Set realm for passpoint credential; realm identifies a set of networks where your passpoint credential can be used
void setSubjectMatch(String subjectMatch)
This method was deprecated in API level 23. in favor of altSubjectMatch
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<WifiEnterpriseConfig> CREATOR

Added in API level 18

Public Constructors

public WifiEnterpriseConfig ()

Added in API level 18

public WifiEnterpriseConfig (WifiEnterpriseConfig source)

Added in API level 18

Copy constructor

Public Methods

public int describeContents ()

Added in API level 18

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public String getAltSubjectMatch ()

Added in API level 23

Get alternate subject match

Returns
  • the alternate subject match string

public String getAnonymousIdentity ()

Added in API level 18

Get the anonymous identity

Returns
  • anonymous identity

public X509Certificate getCaCertificate ()

Added in API level 18

Get CA certificate

Returns
  • X.509 CA certificate

public X509Certificate getClientCertificate ()

Added in API level 18

Get client certificate

Returns
  • X.509 client certificate

public String getDomainSuffixMatch ()

Added in API level 23

Get the domain_suffix_match value. See setDomSuffixMatch.

Returns
  • The domain value.

public int getEapMethod ()

Added in API level 18

Get the eap method.

Returns
  • eap method configured

public String getIdentity ()

Added in API level 18

Get the identity

Returns
  • the identity

public String getPassword ()

Added in API level 18

Get the password. Returns locally set password value. For networks fetched from framework, returns "*".

public int getPhase2Method ()

Added in API level 18

Get the phase 2 authentication method.

Returns

public String getPlmn ()

Added in API level 23

Get plmn (Public Land Mobile Network) for passpoint credential; see (String) for more information

Returns
  • the plmn

public String getRealm ()

Added in API level 23

Get realm for passpoint credential; see setRealm(String) for more information

Returns
  • the realm

public String getSubjectMatch ()

Added in API level 18

This method was deprecated in API level 23.
in favor of altSubjectMatch

Get subject match (deprecated)

Returns
  • the subject match string

public void setAltSubjectMatch (String altSubjectMatch)

Added in API level 23

Set alternate subject match. This is the substring to be matched against the alternate subject of the authentication server certificate.

Parameters
altSubjectMatch substring to be matched, for example DNS:server.example.com;EMAIL:server@example.com

public void setAnonymousIdentity (String anonymousIdentity)

Added in API level 18

Set anonymous identity. This is used as the unencrypted identity with certain EAP types

Parameters
anonymousIdentity the anonymous identity

public void setCaCertificate (X509Certificate cert)

Added in API level 18

Specify a X.509 certificate that identifies the server.

A default name is automatically assigned to the certificate and used 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.

Parameters
cert X.509 CA certificate
Throws
IllegalArgumentException if not a CA certificate

public void setClientKeyEntry (PrivateKey privateKey, X509Certificate clientCertificate)

Added in API level 18

Specify a private key and client certificate for client authorization.

A default name is automatically assigned to the key entry and used 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.

Throws
IllegalArgumentException for an invalid key or certificate.

public void setDomainSuffixMatch (String domain)

Added in API level 23

Set the domain_suffix_match directive on wpa_supplicant. This is the parameter to use for Hotspot 2.0 defined matching of AAA server certs per WFA HS2.0 spec, section 7.3.3.2, second paragraph. From wpa_supplicant documentation: Constraint for server domain name. If set, this FQDN is used as a suffix match requirement for the AAAserver certificate in SubjectAltName dNSName element(s). If a matching dNSName is found, this constraint is met. If no dNSName values are present, this constraint is matched against SubjectName CN using same suffix match comparison. Suffix match here means that the host/domain name is compared one label at a time starting from the top-level domain and all the labels in domain_suffix_match shall be included in the certificate. The certificate may include additional sub-level labels in addition to the required labels. For example, domain_suffix_match=example.com would match test.example.com but would not match test-example.com.

Parameters
domain The domain value

public void setEapMethod (int eapMethod)

Added in API level 18

Set the EAP authentication method.

Parameters
eapMethod is one PEAP, TLS, TTLS or PWD
Throws
IllegalArgumentException on an invalid eap method

public void setIdentity (String identity)

Added in API level 18

Set the identity

public void setPassword (String password)

Added in API level 18

Set the password.

Parameters
password the password

public void setPhase2Method (int phase2Method)

Added in API level 18

Set Phase 2 authentication method. Sets the inner authentication method to be used in phase 2 after setting up a secure channel

Parameters
phase2Method is the inner authentication method and can be one of NONE, PAP, MSCHAP, MSCHAPV2, GTC
Throws
IllegalArgumentException on an invalid phase2 method

public void setPlmn (String plmn)

Added in API level 23

Set plmn (Public Land Mobile Network) of the provider of passpoint credential

Parameters
plmn the plmn value derived from mcc (mobile country code) & mnc (mobile network code)

public void setRealm (String realm)

Added in API level 23

Set realm for passpoint credential; realm identifies a set of networks where your passpoint credential can be used

Parameters
realm the realm

public void setSubjectMatch (String subjectMatch)

Added in API level 18

This method was deprecated in API level 23.
in favor of altSubjectMatch

Set subject match (deprecated). This is the substring to be matched against the subject of the authentication server certificate.

Parameters
subjectMatch substring to be matched

public String toString ()

Added in API level 18

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel dest, int flags)

Added in API level 18

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.