public class WifiEnterpriseConfig extends Object implements Parcelable
Modifier and Type | Class and Description |
---|---|
static class |
WifiEnterpriseConfig.Eap
The Extensible Authentication Protocol method used
|
static class |
WifiEnterpriseConfig.Phase2
The inner authentication method used
|
static interface |
WifiEnterpriseConfig.SupplicantLoader
Interface used for populating a WifiEnterpriseConfig from supplicant configuration
|
static interface |
WifiEnterpriseConfig.SupplicantSaver
Interface used for retrieving supplicant configuration from WifiEnterpriseConfig
|
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static String |
ALTSUBJECT_MATCH_KEY |
static String |
ANON_IDENTITY_KEY |
static String |
CA_CERT_ALIAS_DELIMITER |
static String |
CA_CERT_KEY |
static String |
CA_CERT_PREFIX |
static String |
CA_PATH_KEY |
static String |
CLIENT_CERT_KEY |
static String |
CLIENT_CERT_PREFIX |
static Parcelable.Creator<WifiEnterpriseConfig> |
CREATOR |
static String |
DOM_SUFFIX_MATCH_KEY |
static String |
EAP_KEY |
static String |
EMPTY_VALUE |
static String |
ENGINE_DISABLE
String to set the engine value to when it should be disabled.
|
static String |
ENGINE_ENABLE
String to set the engine value to when it should be enabled.
|
static String |
ENGINE_ID_KEY |
static String |
ENGINE_ID_KEYSTORE
String representing the keystore OpenSSL ENGINE's ID.
|
static String |
ENGINE_KEY |
static String |
IDENTITY_KEY |
static String |
KEYSTORE_URI
String representing the keystore URI used for wpa_supplicant.
|
static String |
KEYSTORES_URI
String representing the keystore URI used for wpa_supplicant,
Unlike #KEYSTORE_URI, this supports a list of space-delimited aliases
|
static String |
OPP_KEY_CACHING |
static String |
PASSWORD_KEY |
static String |
PHASE2_KEY |
static String |
PLMN_KEY |
static String |
PRIVATE_KEY_ID_KEY |
static String |
REALM_KEY |
static String |
SUBJECT_MATCH_KEY |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
WifiEnterpriseConfig() |
WifiEnterpriseConfig(WifiEnterpriseConfig source)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
static String |
decodeCaCertificateAlias(String alias)
Decode a previously-encoded CA certificate alias.
|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
static String |
encodeCaCertificateAlias(String alias)
Encode a CA certificate alias so it does not contain illegal character.
|
String |
getAltSubjectMatch()
Get alternate subject match
|
String |
getAnonymousIdentity()
Get the anonymous identity
|
X509Certificate |
getCaCertificate()
Get CA certificate.
|
String |
getCaCertificateAlias()
Get CA certificate alias
|
String[] |
getCaCertificateAliases()
Get CA certificate aliases
|
X509Certificate[] |
getCaCertificates()
Get CA certificates.
|
String |
getCaPath()
Get the domain_suffix_match value.
|
X509Certificate |
getClientCertificate()
Get client certificate
|
String |
getClientCertificateAlias()
Get client certificate alias
|
PrivateKey |
getClientPrivateKey() |
String |
getDomainSuffixMatch()
Get the domain_suffix_match value.
|
int |
getEapMethod()
Get the eap method.
|
String |
getFieldValue(String key,
String prefix)
Returns the field value for the key.
|
String |
getIdentity()
Get the identity
|
String |
getKeyId(WifiEnterpriseConfig current)
|
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()
Deprecated.
in favor of altSubjectMatch
|
void |
loadFromSupplicant(WifiEnterpriseConfig.SupplicantLoader loader)
Internal use only; retrieve configuration from wpa_supplicant config.
|
void |
resetCaCertificate() |
void |
resetClientKeyEntry() |
boolean |
saveToSupplicant(WifiEnterpriseConfig.SupplicantSaver saver)
Internal use only; supply field values to wpa_supplicant config.
|
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 |
setCaCertificateAlias(String alias)
Set CA certificate alias.
|
void |
setCaCertificateAliases(String[] aliases)
Set CA certificate aliases.
|
void |
setCaCertificates(X509Certificate[] certs)
Specify a list of X.509 certificates that identifies the server.
|
void |
setCaPath(String path)
Set the ca_path directive on wpa_supplicant.
|
void |
setClientCertificateAlias(String alias)
Set Client certificate alias.
|
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 |
setFieldValue(String key,
String value)
Set a value with an optional prefix at key
|
void |
setFieldValue(String key,
String value,
String prefix)
Set a value with an optional prefix at key
|
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)
Deprecated.
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.
|
public static final String EMPTY_VALUE
public static final String EAP_KEY
public static final String PHASE2_KEY
public static final String IDENTITY_KEY
public static final String ANON_IDENTITY_KEY
public static final String PASSWORD_KEY
public static final String SUBJECT_MATCH_KEY
public static final String ALTSUBJECT_MATCH_KEY
public static final String DOM_SUFFIX_MATCH_KEY
public static final String OPP_KEY_CACHING
public static final String ENGINE_ID_KEYSTORE
public static final String KEYSTORE_URI
public static final String KEYSTORES_URI
public static final String ENGINE_ENABLE
public static final String ENGINE_DISABLE
public static final String CA_CERT_PREFIX
public static final String CLIENT_CERT_PREFIX
public static final String CLIENT_CERT_KEY
public static final String CA_CERT_KEY
public static final String CA_PATH_KEY
public static final String ENGINE_KEY
public static final String ENGINE_ID_KEY
public static final String PRIVATE_KEY_ID_KEY
public static final String REALM_KEY
public static final String PLMN_KEY
public static final String CA_CERT_ALIAS_DELIMITER
public static final Parcelable.Creator<WifiEnterpriseConfig> CREATOR
public WifiEnterpriseConfig()
public WifiEnterpriseConfig(WifiEnterpriseConfig source)
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
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.PARCELABLE_WRITE_RETURN_VALUE
.public boolean saveToSupplicant(WifiEnterpriseConfig.SupplicantSaver saver)
saver
.saver
- proxy for setting configuration in wpa_supplciantpublic void loadFromSupplicant(WifiEnterpriseConfig.SupplicantLoader loader)
loader
- proxy for retrieving configuration keys from wpa_supplicantpublic void setEapMethod(int eapMethod)
eapMethod
- is one WifiEnterpriseConfig.Eap.PEAP
, WifiEnterpriseConfig.Eap.TLS
, WifiEnterpriseConfig.Eap.TTLS
or
WifiEnterpriseConfig.Eap.PWD
IllegalArgumentException
- on an invalid eap methodpublic int getEapMethod()
public void setPhase2Method(int phase2Method)
phase2Method
- is the inner authentication method and can be one of WifiEnterpriseConfig.Phase2.NONE
,
WifiEnterpriseConfig.Phase2.PAP
, WifiEnterpriseConfig.Phase2.MSCHAP
, WifiEnterpriseConfig.Phase2.MSCHAPV2
,
WifiEnterpriseConfig.Phase2.GTC
IllegalArgumentException
- on an invalid phase2 methodpublic int getPhase2Method()
WifiEnterpriseConfig.Phase2
public void setIdentity(String identity)
identity
- public String getIdentity()
public void setAnonymousIdentity(String anonymousIdentity)
anonymousIdentity
- the anonymous identitypublic String getAnonymousIdentity()
public void setPassword(String password)
password
- the passwordpublic String getPassword()
public static String encodeCaCertificateAlias(String alias)
public static String decodeCaCertificateAlias(String alias)
public void setCaCertificateAlias(String alias)
See the KeyChain
for details on installing or choosing
a certificate
alias
- identifies the certificatepublic void setCaCertificateAliases(String[] aliases)
encodeCaCertificateAlias(String)
.
See the KeyChain
for details on installing or choosing
a certificate.
aliases
- identifies the certificatepublic String getCaCertificateAlias()
public String[] getCaCertificateAliases()
public void setCaCertificate(X509Certificate cert)
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.
cert
- X.509 CA certificateIllegalArgumentException
- if not a CA certificatepublic X509Certificate getCaCertificate()
public void setCaCertificates(X509Certificate[] certs)
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.
certs
- X.509 CA certificatesIllegalArgumentException
- if any of the provided certificates is
not a CA certificatepublic X509Certificate[] getCaCertificates()
public void resetCaCertificate()
public void setCaPath(String path)
domain
- The path for CA certificate filespublic String getCaPath()
public void setClientCertificateAlias(String alias)
See the KeyChain
for details on installing or choosing
a certificate
alias
- identifies the certificatepublic String getClientCertificateAlias()
public void setClientKeyEntry(PrivateKey privateKey, X509Certificate clientCertificate)
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.
privateKey
- clientCertificate
- IllegalArgumentException
- for an invalid key or certificate.public X509Certificate getClientCertificate()
public void resetClientKeyEntry()
public PrivateKey getClientPrivateKey()
public void setSubjectMatch(String subjectMatch)
subjectMatch
- substring to be matchedpublic String getSubjectMatch()
public void setAltSubjectMatch(String altSubjectMatch)
altSubjectMatch
- substring to be matched, for example
DNS:server.example.com;EMAIL:server@example.compublic String getAltSubjectMatch()
public void setDomainSuffixMatch(String domain)
domain
- The domain valuepublic String getDomainSuffixMatch()
public void setRealm(String realm)
realm
- the realmpublic String getRealm()
setRealm(String)
for more informationpublic void setPlmn(String plmn)
plmn
- the plmn value derived from mcc (mobile country code) & mnc (mobile network code)public String getPlmn()
(String)
for more informationpublic String getKeyId(WifiEnterpriseConfig current)
public String getFieldValue(String key, String prefix)
key
- into the hashprefix
- is the prefix that the value may havepublic void setFieldValue(String key, String value, String prefix)
key
- into the hashvalue
- to be setprefix
- an optional value to be prefixed to actual valuepublic void setFieldValue(String key, String value)
key
- into the hashvalue
- to be setprefix
- an optional value to be prefixed to actual valuepublic String toString()
Object
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())