Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#nestedclasses) \| [Constants](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#constants) \| [Inherited Constants](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#inhconstants) \| [Fields](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#lfields) \| [Ctors](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#pubctors) \| [Methods](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#inhmethods)

# WifiEnterpriseConfig

*** ** * ** ***

` public class WifiEnterpriseConfig `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.wifi.WifiEnterpriseConfig |

<br />

*** ** * ** ***

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

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig.Eap` The Extensible Authentication Protocol method used |
| ` class` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig.Phase2` The inner authentication method used |

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#EXTRA_WAPI_AS_CERTIFICATE_DATA` Intent extra: data for WAPI AS certificates |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#EXTRA_WAPI_AS_CERTIFICATE_NAME` Intent extra: name for WAPI AS certificates |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#EXTRA_WAPI_USER_CERTIFICATE_DATA` Intent extra: data for WAPI USER certificates |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#EXTRA_WAPI_USER_CERTIFICATE_NAME` Intent extra: name for WAPI USER certificates |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_0` Constant definition for TLS v1.0 which is used in `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setMinimumTlsVersion(int)` |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_1` Constant definition for TLS v1.1 which is used in `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setMinimumTlsVersion(int)` |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_2` Constant definition for TLS v1.2 which is used in `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setMinimumTlsVersion(int)` |
| `int` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_3` Constant definition for TLS v1.3 which is used in `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setMinimumTlsVersion(int)` |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#WAPI_AS_CERTIFICATE` Key prefix for WAPI AS certificates. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#WAPI_USER_CERTIFICATE` Key prefix for WAPI user certificates. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig>` | `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#CREATOR` <br /> |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#WifiEnterpriseConfig()() ` |
| ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#WifiEnterpriseConfig(android.net.wifi.WifiEnterpriseConfig)(https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig source) ` Copy constructor. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#enableTrustOnFirstUse(boolean)(boolean enable) ` Enable Trust On First Use. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getAltSubjectMatch()() ` Get alternate subject match |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getAnonymousIdentity()() ` Get the anonymous identity |
| ` https://developer.android.com/reference/java/security/cert/X509Certificate` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getCaCertificate()() ` Get CA certificate. |
| ` https://developer.android.com/reference/java/security/cert/X509Certificate` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getCaCertificates()() ` Get CA certificates. |
| ` https://developer.android.com/reference/java/security/cert/X509Certificate` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getClientCertificate()() ` Get client certificate |
| ` https://developer.android.com/reference/java/security/cert/X509Certificate` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getClientCertificateChain()() ` Get the complete client certificate chain in the same order as it was last supplied. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getClientKeyPairAlias()() ` Get KeyChain alias to use for client authentication. |
| ` https://developer.android.com/reference/java/security/PrivateKey` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getClientPrivateKey()() ` Get the client private key as supplied in `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setClientKeyEntryWithCertificateChain(java.security.PrivateKey,%20java.security.cert.X509Certificate[])`, or null if unset. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getDecoratedIdentityPrefix()() ` Get the decorated identity prefix. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getDomainSuffixMatch()() ` Get the domain_suffix_match value. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getEapMethod()() ` Get the eap method. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getIdentity()() ` Get the identity |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getMinimumTlsVersion()() ` Get the minimum TLS version for TLS-based EAP methods. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getPassword()() ` Get the password. |
| ` int` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getPhase2Method()() ` Get the phase 2 authentication method. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getPlmn()() ` Get plmn (Public Land Mobile Network) for Passpoint credential; see `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setPlmn(java.lang.String)` for more information |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getRealm()() ` Get realm for Passpoint credential; see `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setRealm(java.lang.String)` for more information |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#getSubjectMatch()() ` *This method was deprecated in API level 23. in favor of altSubjectMatch* |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#hasCaCertificate()() ` Indicates whether or not this enterprise config has a CA certificate configured. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isAuthenticationSimBased()() ` Utility method to determine whether the configuration's authentication method is SIM-based. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isEapMethodServerCertUsed()() ` Determines whether an Enterprise configuration's EAP method requires a Root CA certification to validate the authentication server i.e. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isServerCertValidationEnabled()() ` Determines whether an Enterprise configuration enables server certificate validation. |
| ` boolean` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isTrustOnFirstUseEnabled()() ` Indicates whether or not Trust On First Use (TOFU) is enabled. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setAltSubjectMatch(java.lang.String)(https://developer.android.com/reference/java/lang/String altSubjectMatch) ` Set alternate subject match. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setAnonymousIdentity(java.lang.String)(https://developer.android.com/reference/java/lang/String anonymousIdentity) ` Set anonymous identity. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setCaCertificate(java.security.cert.X509Certificate)(https://developer.android.com/reference/java/security/cert/X509Certificate cert) ` Specify a X.509 certificate that identifies the server. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setCaCertificates(java.security.cert.X509Certificate[])(https://developer.android.com/reference/java/security/cert/X509Certificate certs) ` Specify a list of X.509 certificates that identifies the server. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setClientKeyEntry(java.security.PrivateKey,%20java.security.cert.X509Certificate)(https://developer.android.com/reference/java/security/PrivateKey privateKey, https://developer.android.com/reference/java/security/cert/X509Certificate clientCertificate) ` Specify a private key and client certificate for client authorization. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setClientKeyEntryWithCertificateChain(java.security.PrivateKey,%20java.security.cert.X509Certificate[])(https://developer.android.com/reference/java/security/PrivateKey privateKey, https://developer.android.com/reference/java/security/cert/X509Certificate clientCertificateChain) ` Specify a private key and client certificate chain for client authorization. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setClientKeyPairAlias(java.lang.String)(https://developer.android.com/reference/java/lang/String alias) ` Specify a key pair via KeyChain alias for client authentication. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setDecoratedIdentityPrefix(java.lang.String)(https://developer.android.com/reference/java/lang/String decoratedIdentityPrefix) ` Set a prefix for a decorated identity as per RFC 7542. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setDomainSuffixMatch(java.lang.String)(https://developer.android.com/reference/java/lang/String domain) ` Set the domain_suffix_match directive on wpa_supplicant. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setEapMethod(int)(int eapMethod) ` Set the EAP authentication method. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setIdentity(java.lang.String)(https://developer.android.com/reference/java/lang/String identity) ` Set the identity |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setMinimumTlsVersion(int)(int tlsVersion) ` Set the minimum TLS version for TLS-based EAP methods. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setPassword(java.lang.String)(https://developer.android.com/reference/java/lang/String password) ` Set the password. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setPhase2Method(int)(int phase2Method) ` Set Phase 2 authentication method. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setPlmn(java.lang.String)(https://developer.android.com/reference/java/lang/String plmn) ` Set plmn (Public Land Mobile Network) of the provider of Passpoint credential |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setRealm(java.lang.String)(https://developer.android.com/reference/java/lang/String realm) ` Set realm for Passpoint credential; realm identifies a set of networks where your Passpoint credential can be used |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setSubjectMatch(java.lang.String)(https://developer.android.com/reference/java/lang/String subjectMatch) ` *This method was deprecated in API level 23. in favor of altSubjectMatch* |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### EXTRA_WAPI_AS_CERTIFICATE_DATA

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_WAPI_AS_CERTIFICATE_DATA
```

Intent extra: data for WAPI AS certificates

<br />

Constant Value: "android.net.wifi.extra.WAPI_AS_CERTIFICATE_DATA"

### EXTRA_WAPI_AS_CERTIFICATE_NAME

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_WAPI_AS_CERTIFICATE_NAME
```

Intent extra: name for WAPI AS certificates

<br />

Constant Value: "android.net.wifi.extra.WAPI_AS_CERTIFICATE_NAME"

### EXTRA_WAPI_USER_CERTIFICATE_DATA

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_WAPI_USER_CERTIFICATE_DATA
```

Intent extra: data for WAPI USER certificates

<br />

Constant Value: "android.net.wifi.extra.WAPI_USER_CERTIFICATE_DATA"

### EXTRA_WAPI_USER_CERTIFICATE_NAME

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_WAPI_USER_CERTIFICATE_NAME
```

Intent extra: name for WAPI USER certificates

<br />

Constant Value: "android.net.wifi.extra.WAPI_USER_CERTIFICATE_NAME"

### TLS_V1_0

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TLS_V1_0
```

Constant definition for TLS v1.0 which is used in `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setMinimumTlsVersion(int)`

<br />

Constant Value: 0 (0x00000000)

### TLS_V1_1

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TLS_V1_1
```

Constant definition for TLS v1.1 which is used in `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setMinimumTlsVersion(int)`

<br />

Constant Value: 1 (0x00000001)

### TLS_V1_2

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TLS_V1_2
```

Constant definition for TLS v1.2 which is used in `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setMinimumTlsVersion(int)`

<br />

Constant Value: 2 (0x00000002)

### TLS_V1_3

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TLS_V1_3
```

Constant definition for TLS v1.3 which is used in `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setMinimumTlsVersion(int)`

<br />

Constant Value: 3 (0x00000003)

### WAPI_AS_CERTIFICATE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String WAPI_AS_CERTIFICATE
```

Key prefix for WAPI AS certificates.

<br />

Constant Value: "WAPIAS_"

### WAPI_USER_CERTIFICATE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String WAPI_USER_CERTIFICATE
```

Key prefix for WAPI user certificates.

<br />

Constant Value: "WAPIUSR_"

## Fields

### CREATOR

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<WifiEnterpriseConfig> CREATOR
```

<br />

<br />

## Public constructors

### WifiEnterpriseConfig

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WifiEnterpriseConfig ()
```

<br />

<br />

### WifiEnterpriseConfig

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WifiEnterpriseConfig (WifiEnterpriseConfig source)
```

Copy constructor. This copies over all the fields verbatim (does not ignore masked password fields).

<br />

| Parameters ||
|---|---|
| `source` | `WifiEnterpriseConfig`: Source WifiEnterpriseConfig object. <br /> |

## Public methods

### describeContents

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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 `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### enableTrustOnFirstUse

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enableTrustOnFirstUse (boolean enable)
```

Enable Trust On First Use. Trust On First Use (TOFU) simplifies manual or partial configurations of TLS-based EAP networks. TOFU operates by installing the Root CA cert which is received from the server during an initial connection to a new network. Such installation is gated by user approval. Use only when it is not possible to configure the Root CA cert for the server.   

Note: If a Root CA cert is already configured, this option is ignored, e.g. if `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setCaCertificate(java.security.cert.X509Certificate)`, or `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setCaCertificates(java.security.cert.X509Certificate[])` is called.

<br />

| Parameters ||
|---|---|
| `enable` | `boolean`: true to enable; false otherwise (the default if the method is not called). <br /> |

### getAltSubjectMatch

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getAltSubjectMatch ()
```

Get alternate subject match

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the alternate subject match string <br /> |

### getAnonymousIdentity

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getAnonymousIdentity ()
```

Get the anonymous identity

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | anonymous identity <br /> |

### getCaCertificate

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public X509Certificate getCaCertificate ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/X509Certificate` | X.509 CA certificate. This value may be `null`. <br /> |

### getCaCertificates

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public X509Certificate[] getCaCertificates ()
```

Get CA certificates.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/X509Certificate` | This value may be `null`. <br /> |

### getClientCertificate

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public X509Certificate getClientCertificate ()
```

Get client certificate

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/X509Certificate` | X.509 client certificate <br /> |

### getClientCertificateChain

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public X509Certificate[] getClientCertificateChain ()
```

Get the complete client certificate chain in the same order as it was last supplied.

If the chain was last supplied by a call to `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setClientKeyEntry(java.security.PrivateKey,%20java.security.cert.X509Certificate)` with a non-null \* certificate instance, a single-element array containing the certificate will be \* returned. If `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setClientKeyEntryWithCertificateChain(java.security.PrivateKey,%20java.security.cert.X509Certificate[])` was last called with a non-empty array, this array will be returned in the same order as it was supplied. Otherwise, `null` will be returned.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/X509Certificate` | X.509 client certificates <br /> |

### getClientKeyPairAlias

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getClientKeyPairAlias ()
```

Get KeyChain alias to use for client authentication.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value may be `null`. <br /> |

### getClientPrivateKey

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PrivateKey getClientPrivateKey ()
```

Get the client private key as supplied in `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setClientKeyEntryWithCertificateChain(java.security.PrivateKey,%20java.security.cert.X509Certificate[])`, or null if unset.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/PrivateKey` | <br /> |

### getDecoratedIdentityPrefix

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getDecoratedIdentityPrefix ()
```

Get the decorated identity prefix.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The decorated identity prefix. This value may be `null`. <br /> |

### getDomainSuffixMatch

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getDomainSuffixMatch ()
```

Get the domain_suffix_match value. See setDomSuffixMatch.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The domain value. <br /> |

### getEapMethod

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getEapMethod ()
```

Get the eap method.

<br />

| Returns ||
|---|---|
| `int` | eap method configured <br /> |

### getIdentity

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getIdentity ()
```

Get the identity

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the identity <br /> |

### getMinimumTlsVersion

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMinimumTlsVersion ()
```

Get the minimum TLS version for TLS-based EAP methods.

<br />

| Returns ||
|---|---|
| `int` | the TLS version. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_0` - `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_1` - `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_2` - `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_3` |

### getPassword

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getPassword ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getPhase2Method

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getPhase2Method ()
```

Get the phase 2 authentication method.

<br />

| Returns ||
|---|---|
| `int` | a phase 2 method defined at `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig.Phase2` <br /> |

### getPlmn

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getPlmn ()
```

Get plmn (Public Land Mobile Network) for Passpoint credential; see `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setPlmn(java.lang.String)` for more information

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the plmn <br /> |

### getRealm

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getRealm ()
```

Get realm for Passpoint credential; see `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setRealm(java.lang.String)` for more information

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the realm <br /> |

### getSubjectMatch

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getSubjectMatch ()
```

<br />

**This method was deprecated in API level 23.**   

in favor of altSubjectMatch

Get subject match (deprecated)

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the subject match string <br /> |

### hasCaCertificate

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean hasCaCertificate ()
```

Indicates whether or not this enterprise config has a CA certificate configured.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isAuthenticationSimBased

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAuthenticationSimBased ()
```

Utility method to determine whether the configuration's authentication method is SIM-based.

<br />

| Returns ||
|---|---|
| `boolean` | true if the credential information requires SIM card for current authentication method, otherwise it returns false. <br /> |

### isEapMethodServerCertUsed

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isEapMethodServerCertUsed ()
```

Determines whether an Enterprise configuration's EAP method requires a Root CA certification to validate the authentication server i.e. PEAP, TLS, UNAUTH_TLS, or TTLS.

<br />

| Returns ||
|---|---|
| `boolean` | True if configuration requires a CA certification, false otherwise. <br /> |

### isServerCertValidationEnabled

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isServerCertValidationEnabled ()
```

Determines whether an Enterprise configuration enables server certificate validation.

The caller can determine, along with `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isEapMethodServerCertUsed()`, if an Enterprise configuration enables server certificate validation, which is a mandatory requirement for networks that use TLS based EAP methods. A configuration that does not enable server certificate validation will be ignored and will not be considered for network selection. A network suggestion with such a configuration will cause an IllegalArgumentException to be thrown when suggested. Server validation is achieved by the following: - Either certificate or CA path is configured. - Either alternative subject match or domain suffix match is set.

<br />

| Returns ||
|---|---|
| `boolean` | True for server certificate validation is enabled, false otherwise. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | on configuration which doesn't use server certificate. |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isEapMethodServerCertUsed()`

### isTrustOnFirstUseEnabled

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isTrustOnFirstUseEnabled ()
```

Indicates whether or not Trust On First Use (TOFU) is enabled.

<br />

| Returns ||
|---|---|
| `boolean` | Trust On First Use is enabled or not. <br /> |

### setAltSubjectMatch

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setAltSubjectMatch (String altSubjectMatch)
```

Set alternate subject match. This is the substring to be matched against the alternate subject of the authentication server certificate. Note: If no alternate subject is set for an Enterprise configuration, either by not calling this API, or by calling it with null, or not setting domain suffix match using the `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setDomainSuffixMatch(java.lang.String)`, then the server certificate validation is incomplete - which means that the connection is not secure.

<br />

| Parameters ||
|---|---|
| `altSubjectMatch` | `String`: substring to be matched, for example DNS:server.example.com;EMAIL:server@example.com <br /> |

### setAnonymousIdentity

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setAnonymousIdentity (String anonymousIdentity)
```

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

<br />

| Parameters ||
|---|---|
| `anonymousIdentity` | `String`: the anonymous identity <br /> |

### setCaCertificate

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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. Note: If no certificate is set for an Enterprise configuration, either by not calling this API (or the `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setCaCertificates(java.security.cert.X509Certificate[])`, or by calling it with null, then the server certificate validation is skipped - which means that the connection is not secure.

<br />

| Parameters ||
|---|---|
| `cert` | `X509Certificate`: X.509 CA certificate. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if not a CA certificate |

### setCaCertificates

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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. Note: If no certificates are set for an Enterprise configuration, either by not calling this API (or the `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setCaCertificate(java.security.cert.X509Certificate)`, or by calling it with null, then the server certificate validation is skipped - which means that the connection is not secure.

<br />

| Parameters ||
|---|---|
| `certs` | `X509Certificate`: X.509 CA certificates. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if any of the provided certificates is not a CA certificate, or if too many CA certificates are provided |

### setClientKeyEntry

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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.

<br />

| Parameters ||
|---|---|
| `privateKey` | `PrivateKey`: a PrivateKey instance for the end certificate. <br /> |
| `clientCertificate` | `X509Certificate`: an X509Certificate representing the end certificate. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | for an invalid key or certificate. |

### setClientKeyEntryWithCertificateChain

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setClientKeyEntryWithCertificateChain (PrivateKey privateKey, 
                X509Certificate[] clientCertificateChain)
```

Specify a private key and client certificate chain 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.

<br />

| Parameters ||
|---|---|
| `privateKey` | `PrivateKey`: a PrivateKey instance for the end certificate. <br /> |
| `clientCertificateChain` | `X509Certificate`: an array of X509Certificate instances which starts with end certificate and continues with additional CA certificates necessary to link the end certificate with some root certificate known by the authenticator. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | for an invalid key or certificate. |

### setClientKeyPairAlias

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setClientKeyPairAlias (String alias)
```

Specify a key pair via KeyChain alias for client authentication. The alias should refer to a key pair in KeyChain that is allowed for WiFi authentication.

<br />

| Parameters ||
|---|---|
| `alias` | `String`: key pair alias. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/admin/DevicePolicyManager#grantKeyPairToWifiAuth(java.lang.String)`

### setDecoratedIdentityPrefix

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setDecoratedIdentityPrefix (String decoratedIdentityPrefix)
```

Set a prefix for a decorated identity as per RFC 7542. This prefix must contain a list of realms (could be a list of 1) delimited by a '!' character. e.g. homerealm.example.org! or proxyrealm.example.net!homerealm.example.org! A prefix of "homerealm.example.org!" will generate a decorated identity that looks like: homerealm.example.org!user@otherrealm.example.net Calling with a null parameter will clear the decorated prefix. Note: Caller must verify that the device supports this feature by calling `https://developer.android.com/reference/android/net/wifi/WifiManager#isDecoratedIdentitySupported()`

<br />

| Parameters ||
|---|---|
| `decoratedIdentityPrefix` | `String`: The prefix to add to the outer/anonymous identity. This value may be `null`. <br /> |

### setDomainSuffixMatch

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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.

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.

More than one match string can be provided by using semicolons to separate the strings (e.g., example.org;example.com). When multiple strings are specified, a match with any one of the values is considered a sufficient match for the certificate, i.e., the conditions are ORed ogether.

For example, domain_suffix_match=example.com would match test.example.com but would not match test-example.com. Note: If no domain suffix is set for an Enterprise configuration, either by not calling this API, or by calling it with null, or not setting alternate subject match using the `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#setAltSubjectMatch(java.lang.String)`, then the server certificate validation is incomplete - which means that the connection is not secure.

<br />

| Parameters ||
|---|---|
| `domain` | `String`: The domain value <br /> |

### setEapMethod

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setEapMethod (int eapMethod)
```

Set the EAP authentication method.

<br />

| Parameters ||
|---|---|
| `eapMethod` | `int`: is one of `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig.Eap`, except for `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig.Eap#NONE` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | on an invalid eap method |

### setIdentity

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setIdentity (String identity)
```

Set the identity

<br />

### setMinimumTlsVersion

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setMinimumTlsVersion (int tlsVersion)
```

Set the minimum TLS version for TLS-based EAP methods. `https://developer.android.com/reference/android/net/wifi/WifiManager#isTlsMinimumVersionSupported()` indicates whether or not a minimum TLS version can be set. If not supported, the minimum TLS version is always TLS v1.0.

`https://developer.android.com/reference/android/net/wifi/WifiManager#isTlsV13Supported()` indicates whether or not TLS v1.3 is supported. If requested minimum is not supported, it will default to the maximum supported version.

<br />

| Parameters ||
|---|---|
| `tlsVersion` | `int`: the TLS version. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_0` - `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_1` - `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_2` - `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#TLS_V1_3` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the TLS version is invalid. |

### setPassword

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setPassword (String password)
```

Set the password.

<br />

| Parameters ||
|---|---|
| `password` | `String`: the password <br /> |

### setPhase2Method

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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

<br />

| Parameters ||
|---|---|
| `phase2Method` | `int`: is the inner authentication method and can be one of `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig.Phase2` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | on an invalid phase2 method |

### setPlmn

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setPlmn (String plmn)
```

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

<br />

| Parameters ||
|---|---|
| `plmn` | `String`: the plmn value derived from mcc (mobile country code) \& mnc (mobile network code) <br /> |

### setRealm

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setRealm (String realm)
```

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

<br />

| Parameters ||
|---|---|
| `realm` | `String`: the realm <br /> |

### setSubjectMatch

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setSubjectMatch (String subjectMatch)
```

<br />

**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.

<br />

| Parameters ||
|---|---|
| `subjectMatch` | `String`: substring to be matched <br /> |

### toString

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |