Most visited

Recently visited

Added in API level 18

WifiEnterpriseConfig

public class WifiEnterpriseConfig
extends Object implements Parcelable

java.lang.Object
   ↳ android.net.wifi.WifiEnterpriseConfig


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  

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 instance's marshaled representation.

String getAltSubjectMatch()

Get alternate subject match

String getAnonymousIdentity()

Get the anonymous identity

X509Certificate getCaCertificate()

Get CA certificate.

X509Certificate[] getCaCertificates()

Get CA certificates.

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 setCaCertificates(X509Certificate[] certs)

Specify a list of X.509 certificates 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 representation of the object.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable

Fields

CREATOR

Added in API level 18
Creator<WifiEnterpriseConfig> CREATOR

Public constructors

WifiEnterpriseConfig

Added in API level 18
WifiEnterpriseConfig ()

WifiEnterpriseConfig

Added in API level 18
WifiEnterpriseConfig (WifiEnterpriseConfig source)

Copy constructor

Parameters
source WifiEnterpriseConfig

Public methods

describeContents

Added in API level 18
int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getAltSubjectMatch

Added in API level 23
String getAltSubjectMatch ()

Get alternate subject match

Returns
String the alternate subject match string

getAnonymousIdentity

Added in API level 18
String getAnonymousIdentity ()

Get the anonymous identity

Returns
String anonymous identity

getCaCertificate

Added in API level 18
X509Certificate getCaCertificate ()

Get CA certificate. If multiple CA certificates are configured previously, return the first one.

Returns
X509Certificate X.509 CA certificate

getCaCertificates

Added in API level 24
X509Certificate[] getCaCertificates ()

Get CA certificates.

Returns
X509Certificate[]

getClientCertificate

Added in API level 18
X509Certificate getClientCertificate ()

Get client certificate

Returns
X509Certificate X.509 client certificate

getDomainSuffixMatch

Added in API level 23
String getDomainSuffixMatch ()

Get the domain_suffix_match value. See setDomSuffixMatch.

Returns
String The domain value.

getEapMethod

Added in API level 18
int getEapMethod ()

Get the eap method.

Returns
int eap method configured

getIdentity

Added in API level 18
String getIdentity ()

Get the identity

Returns
String the identity

getPassword

Added in API level 18
String getPassword ()

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

Returns
String

getPhase2Method

Added in API level 18
int getPhase2Method ()

Get the phase 2 authentication method.

Returns
int a phase 2 method defined at WifiEnterpriseConfig.Phase2

getPlmn

Added in API level 23
String getPlmn ()

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

Returns
String the plmn

getRealm

Added in API level 23
String getRealm ()

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

Returns
String the realm

getSubjectMatch

Added in API level 18
String getSubjectMatch ()

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

Get subject match (deprecated)

Returns
String the subject match string

setAltSubjectMatch

Added in API level 23
void setAltSubjectMatch (String altSubjectMatch)

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

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

setAnonymousIdentity

Added in API level 18
void setAnonymousIdentity (String anonymousIdentity)

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

Parameters
anonymousIdentity String: the anonymous identity

setCaCertificate

Added in API level 18
void setCaCertificate (X509Certificate cert)

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 X509Certificate: X.509 CA certificate
Throws
IllegalArgumentException if not a CA certificate

setCaCertificates

Added in API level 24
void setCaCertificates (X509Certificate[] certs)

Specify a list of X.509 certificates that identifies the server. The validation passes if the CA of server certificate matches one of the given certificates.

Default names are automatically assigned to the certificates and used with this configuration. The framework takes care of installing the certificates when the config is saved and removing the certificates when the config is removed.

Parameters
certs X509Certificate: X.509 CA certificates
Throws
IllegalArgumentException if any of the provided certificates is not a CA certificate

setClientKeyEntry

Added in API level 18
void setClientKeyEntry (PrivateKey privateKey, 
                X509Certificate clientCertificate)

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.

setDomainSuffixMatch

Added in API level 23
void setDomainSuffixMatch (String domain)

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 String: The domain value

setEapMethod

Added in API level 18
void setEapMethod (int eapMethod)

Set the EAP authentication method.

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

setIdentity

Added in API level 18
void setIdentity (String identity)

Set the identity

setPassword

Added in API level 18
void setPassword (String password)

Set the password.

Parameters
password String: the password

setPhase2Method

Added in API level 18
void setPhase2Method (int phase2Method)

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

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

setPlmn

Added in API level 23
void setPlmn (String plmn)

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

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

setRealm

Added in API level 23
void setRealm (String realm)

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

Parameters
realm String: the realm

setSubjectMatch

Added in API level 18
void setSubjectMatch (String subjectMatch)

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 String: substring to be matched

toString

Added in API level 18
String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

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

Returns
String a string representation of the object.

writeToParcel

Added in API level 18
void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

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

Hooray!