EapSessionConfig.Builder


public static final class EapSessionConfig.Builder
extends Object

java.lang.Object
   ↳ android.net.eap.EapSessionConfig.Builder


This class can be used to incrementally construct an EapSessionConfig.

Summary

Public constructors

Builder()

Constructs and returns a new Builder for constructing an EapSessionConfig.

Public methods

EapSessionConfig build()

Constructs and returns an EapSessionConfig with the configurations applied to this Builder.

EapSessionConfig.Builder setEapAkaConfig(int subId, int apptype, EapSessionConfig.EapAkaOption options)

Sets the configuration for EAP AKA with options.

EapSessionConfig.Builder setEapAkaConfig(int subId, int apptype)

Sets the configuration for EAP AKA.

EapSessionConfig.Builder setEapAkaPrimeConfig(int subId, int apptype, String networkName, boolean allowMismatchedNetworkNames)

Sets the configuration for EAP AKA'.

EapSessionConfig.Builder setEapIdentity(byte[] eapIdentity)

Sets the client's EAP Identity.

EapSessionConfig.Builder setEapMsChapV2Config(String username, String password)

Sets the configuration for EAP MSCHAPv2.

EapSessionConfig.Builder setEapSimConfig(int subId, int apptype)

Sets the configuration for EAP SIM.

EapSessionConfig.Builder setEapTtlsConfig(X509Certificate serverCaCert, EapSessionConfig innerEapSessionConfig)

Sets the configuration for EAP-TTLS.

Inherited methods

Public constructors

Builder

Added in API level 31
public Builder ()

Constructs and returns a new Builder for constructing an EapSessionConfig.

Public methods

build

Added in API level 31
public EapSessionConfig build ()

Constructs and returns an EapSessionConfig with the configurations applied to this Builder.

Returns
EapSessionConfig the EapSessionConfig constructed by this Builder. This value cannot be null.

setEapAkaConfig

Added in API level 33
public EapSessionConfig.Builder setEapAkaConfig (int subId, 
                int apptype, 
                EapSessionConfig.EapAkaOption options)

Sets the configuration for EAP AKA with options.

Parameters
subId int: int the client's subId to be authenticated.

apptype int: the apptype to be used for authentication. Value is TelephonyManager.APPTYPE_SIM, TelephonyManager.APPTYPE_USIM, TelephonyManager.APPTYPE_RUIM, TelephonyManager.APPTYPE_CSIM, or TelephonyManager.APPTYPE_ISIM

options EapSessionConfig.EapAkaOption: optional configuration for EAP AKA This value cannot be null.

Returns
EapSessionConfig.Builder Builder this, to facilitate chaining. This value cannot be null.

setEapAkaConfig

Added in API level 31
public EapSessionConfig.Builder setEapAkaConfig (int subId, 
                int apptype)

Sets the configuration for EAP AKA.

Parameters
subId int: int the client's subId to be authenticated.

apptype int: the apptype to be used for authentication. Value is TelephonyManager.APPTYPE_SIM, TelephonyManager.APPTYPE_USIM, TelephonyManager.APPTYPE_RUIM, TelephonyManager.APPTYPE_CSIM, or TelephonyManager.APPTYPE_ISIM

Returns
EapSessionConfig.Builder Builder this, to facilitate chaining. This value cannot be null.

setEapAkaPrimeConfig

Added in API level 31
public EapSessionConfig.Builder setEapAkaPrimeConfig (int subId, 
                int apptype, 
                String networkName, 
                boolean allowMismatchedNetworkNames)

Sets the configuration for EAP AKA'.

Parameters
subId int: int the client's subId to be authenticated.

apptype int: the apptype to be used for authentication. Value is TelephonyManager.APPTYPE_SIM, TelephonyManager.APPTYPE_USIM, TelephonyManager.APPTYPE_RUIM, TelephonyManager.APPTYPE_CSIM, or TelephonyManager.APPTYPE_ISIM

networkName String: String the network name to be used for authentication. This value cannot be null.

allowMismatchedNetworkNames boolean: indicates whether the EAP library can ignore potential mismatches between the given network name and that received in an EAP-AKA' session. If false, mismatched network names will be handled as an Authentication Reject message.

Returns
EapSessionConfig.Builder Builder this, to facilitate chaining. This value cannot be null.

setEapIdentity

Added in API level 31
public EapSessionConfig.Builder setEapIdentity (byte[] eapIdentity)

Sets the client's EAP Identity.

Parameters
eapIdentity byte: byte[] representing the client's EAP Identity. This value cannot be null.

Returns
EapSessionConfig.Builder Builder this, to facilitate chaining. This value cannot be null.

setEapMsChapV2Config

Added in API level 31
public EapSessionConfig.Builder setEapMsChapV2Config (String username, 
                String password)

Sets the configuration for EAP MSCHAPv2.

Parameters
username String: String the client account's username to be authenticated. This value cannot be null.

password String: String the client account's password to be authenticated. This value cannot be null.

Returns
EapSessionConfig.Builder Builder this, to faciliate chaining. This value cannot be null.

setEapSimConfig

Added in API level 31
public EapSessionConfig.Builder setEapSimConfig (int subId, 
                int apptype)

Sets the configuration for EAP SIM.

Parameters
subId int: int the client's subId to be authenticated.

apptype int: the apptype to be used for authentication. Value is TelephonyManager.APPTYPE_SIM, TelephonyManager.APPTYPE_USIM, TelephonyManager.APPTYPE_RUIM, TelephonyManager.APPTYPE_CSIM, or TelephonyManager.APPTYPE_ISIM

Returns
EapSessionConfig.Builder Builder this, to facilitate chaining. This value cannot be null.

setEapTtlsConfig

Added in API level 31
public EapSessionConfig.Builder setEapTtlsConfig (X509Certificate serverCaCert, 
                EapSessionConfig innerEapSessionConfig)

Sets the configuration for EAP-TTLS.

Tunneled EAP-TTLS authentications are disallowed, as running multiple layers of EAP-TTLS increases the data footprint but has no discernible benefits over a single EAP-TTLS session with a non EAP-TTLS method nested inside it.

Parameters
serverCaCert X509Certificate: the CA certificate for validating the received server certificate(s). If a certificate is provided, it MUST be the root CA used by the server, or authentication will fail. If no certificate is provided, any root CA in the system's truststore is considered acceptable. This value may be null.

innerEapSessionConfig EapSessionConfig: represents the configuration for the inner EAP instance This value cannot be null.

Returns
EapSessionConfig.Builder Builder this, to facilitate chaining This value cannot be null.