Builder
class Builder
kotlin.Any | |
↳ | 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 |
Public methods | |
---|---|
EapSessionConfig |
build() Constructs and returns an EapSessionConfig with the configurations applied to this Builder. |
EapSessionConfig.Builder |
setEapAkaConfig(subId: Int, apptype: Int) Sets the configuration for EAP AKA. |
EapSessionConfig.Builder |
setEapAkaConfig(subId: Int, apptype: Int, options: EapSessionConfig.EapAkaOption) Sets the configuration for EAP AKA with options. |
EapSessionConfig.Builder |
setEapAkaPrimeConfig(subId: Int, apptype: Int, networkName: String, allowMismatchedNetworkNames: Boolean) Sets the configuration for EAP AKA'. |
EapSessionConfig.Builder |
setEapIdentity(eapIdentity: ByteArray) Sets the client's EAP Identity. |
EapSessionConfig.Builder |
setEapMsChapV2Config(username: String, password: String) Sets the configuration for EAP MSCHAPv2. |
EapSessionConfig.Builder |
setEapSimConfig(subId: Int, apptype: Int) Sets the configuration for EAP SIM. |
EapSessionConfig.Builder |
setEapTtlsConfig(serverCaCert: X509Certificate?, innerEapSessionConfig: EapSessionConfig) Sets the configuration for EAP-TTLS. |
Public constructors
Builder
Builder()
Constructs and returns a new Builder for constructing an EapSessionConfig
.
Public methods
build
fun build(): EapSessionConfig
Constructs and returns an EapSessionConfig with the configurations applied to this Builder.
Return | |
---|---|
EapSessionConfig |
the EapSessionConfig constructed by this Builder. This value cannot be null . |
setEapAkaConfig
fun setEapAkaConfig(
subId: Int,
apptype: Int
): EapSessionConfig.Builder
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 android.telephony.TelephonyManager#APPTYPE_SIM , android.telephony.TelephonyManager#APPTYPE_USIM , android.telephony.TelephonyManager#APPTYPE_RUIM , android.telephony.TelephonyManager#APPTYPE_CSIM , or android.telephony.TelephonyManager#APPTYPE_ISIM |
Return | |
---|---|
EapSessionConfig.Builder |
Builder this, to facilitate chaining. This value cannot be null . |
setEapAkaConfig
fun setEapAkaConfig(
subId: Int,
apptype: Int,
options: EapSessionConfig.EapAkaOption
): EapSessionConfig.Builder
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 android.telephony.TelephonyManager#APPTYPE_SIM , android.telephony.TelephonyManager#APPTYPE_USIM , android.telephony.TelephonyManager#APPTYPE_RUIM , android.telephony.TelephonyManager#APPTYPE_CSIM , or android.telephony.TelephonyManager#APPTYPE_ISIM |
options |
EapSessionConfig.EapAkaOption: optional configuration for EAP AKA This value cannot be null . |
Return | |
---|---|
EapSessionConfig.Builder |
Builder this, to facilitate chaining. This value cannot be null . |
setEapAkaPrimeConfig
fun setEapAkaPrimeConfig(
subId: Int,
apptype: Int,
networkName: String,
allowMismatchedNetworkNames: Boolean
): EapSessionConfig.Builder
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 android.telephony.TelephonyManager#APPTYPE_SIM , android.telephony.TelephonyManager#APPTYPE_USIM , android.telephony.TelephonyManager#APPTYPE_RUIM , android.telephony.TelephonyManager#APPTYPE_CSIM , or android.telephony.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. |
Return | |
---|---|
EapSessionConfig.Builder |
Builder this, to facilitate chaining. This value cannot be null . |
setEapIdentity
fun setEapIdentity(eapIdentity: ByteArray): EapSessionConfig.Builder
Sets the client's EAP Identity.
Parameters | |
---|---|
eapIdentity |
ByteArray: byte[] representing the client's EAP Identity. This value cannot be null . |
Return | |
---|---|
EapSessionConfig.Builder |
Builder this, to facilitate chaining. This value cannot be null . |
setEapMsChapV2Config
fun setEapMsChapV2Config(
username: String,
password: String
): EapSessionConfig.Builder
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 . |
Return | |
---|---|
EapSessionConfig.Builder |
Builder this, to faciliate chaining. This value cannot be null . |
setEapSimConfig
fun setEapSimConfig(
subId: Int,
apptype: Int
): EapSessionConfig.Builder
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 android.telephony.TelephonyManager#APPTYPE_SIM , android.telephony.TelephonyManager#APPTYPE_USIM , android.telephony.TelephonyManager#APPTYPE_RUIM , android.telephony.TelephonyManager#APPTYPE_CSIM , or android.telephony.TelephonyManager#APPTYPE_ISIM |
Return | |
---|---|
EapSessionConfig.Builder |
Builder this, to facilitate chaining. This value cannot be null . |
setEapTtlsConfig
fun setEapTtlsConfig(
serverCaCert: X509Certificate?,
innerEapSessionConfig: EapSessionConfig
): EapSessionConfig.Builder
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 . |
Return | |
---|---|
EapSessionConfig.Builder |
Builder this, to facilitate chaining This value cannot be null . |