Added in API level 33

Builder

class Builder
kotlin.Any
   ↳ android.net.wifi.aware.WifiAwareDataPathSecurityConfig.Builder

A builder class for a Wi-Fi Aware data-path security config to encrypt an Aware connection.

Summary

Public constructors
Builder(cipherSuite: Int)

Create a builder for a Wi-Fi Aware data-path security config to encrypt the link with specified cipher suite.

Public methods
WifiAwareDataPathSecurityConfig

Create a WifiAwareDataPathSecurityConfig to set in WifiAwareNetworkSpecifier.Builder#setDataPathSecurityConfig(WifiAwareDataPathSecurityConfig) to encrypt the link.

WifiAwareDataPathSecurityConfig.Builder

Configure the PMK for the Wi-Fi Aware connection being requested.

WifiAwareDataPathSecurityConfig.Builder

Configure the PMKID for the Wi-Fi Aware connection being requested.

WifiAwareDataPathSecurityConfig.Builder
setPskPassphrase(pskPassphrase: String)

Configure the PSK Passphrase for the Wi-Fi Aware connection being requested.

Public constructors

Public methods

build

Added in API level 33
fun build(): WifiAwareDataPathSecurityConfig

Create a WifiAwareDataPathSecurityConfig to set in WifiAwareNetworkSpecifier.Builder#setDataPathSecurityConfig(WifiAwareDataPathSecurityConfig) to encrypt the link.

Return
WifiAwareDataPathSecurityConfig A WifiAwareDataPathSecurityConfig to be used for encrypting the Wi-Fi Aware data-path. This value cannot be null.

setPmk

Added in API level 33
fun setPmk(pmk: ByteArray): WifiAwareDataPathSecurityConfig.Builder

Configure the PMK for the Wi-Fi Aware connection being requested. For shared key cipher suite Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_SK_128 and Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_SK_256, either passphrase or PMK must be set. For public key cipher suite Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_PK_128 and Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_PK_256. Both PMK and PMKID must be set.

Parameters
pmk ByteArray: A PMK (pairwise master key, see IEEE 802.11i) specifying the key to use for encrypting the data-path. Alternatively, use the setPskPassphrase(java.lang.String) to specify a Passphrase instead for shared key cipher suite. Use the setPmkId(byte[]) together for public key cipher suite. This value cannot be null.
Return
WifiAwareDataPathSecurityConfig.Builder the current Builder builder, enabling chaining of builder methods. This value cannot be null.

setPmkId

Added in API level 33
fun setPmkId(pmkId: ByteArray): WifiAwareDataPathSecurityConfig.Builder

Configure the PMKID for the Wi-Fi Aware connection being requested. For public key cipher suite Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_PK_128 and Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_PK_256. both PMK and PMKID must set setPmk(byte[])

Parameters
pmkId ByteArray: A PMKID (pairwise master key associated identifier, see IEEE 802.11) is generated by Diffie-Hellman key exchange together with a Pairwise Master Key (PMK), specifying the identifier associated to the key to use for encrypting the data-path. Use the setPmk(byte[]) together for public key cipher suite. This value cannot be null.
Return
WifiAwareDataPathSecurityConfig.Builder the current Builder builder, enabling chaining of builder methods. This value cannot be null.

setPskPassphrase

Added in API level 33
fun setPskPassphrase(pskPassphrase: String): WifiAwareDataPathSecurityConfig.Builder

Configure the PSK Passphrase for the Wi-Fi Aware connection being requested. For shared key cipher suite Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_SK_128 and Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_SK_256, either passphrase or PMK must be set.

Parameters
pskPassphrase String: The passphrase to be used to encrypt the link. Alternatively, use the setPmk(byte[]) to specify a PMK for shared key cipher suite. This value cannot be null.
Return
WifiAwareDataPathSecurityConfig.Builder the current Builder builder, enabling chaining of builder methods. This value cannot be null.