WifiAwareDataPathSecurityConfig.Builder


public static final class WifiAwareDataPathSecurityConfig.Builder
extends Object

java.lang.Object
   ↳ 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(int cipherSuite)

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

Public methods

WifiAwareDataPathSecurityConfig build()

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

WifiAwareDataPathSecurityConfig.Builder setPmk(byte[] pmk)

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

WifiAwareDataPathSecurityConfig.Builder setPmkId(byte[] pmkId)

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

WifiAwareDataPathSecurityConfig.Builder setPskPassphrase(String pskPassphrase)

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

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(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 wait(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 wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

Added in API level 33
public Builder (int cipherSuite)

Create a builder for a Wi-Fi Aware data-path security config to encrypt the link with specified cipher suite. Use Characteristics.getSupportedCipherSuites() to get the supported capabilities of the device.

Public methods

build

Added in API level 33
public WifiAwareDataPathSecurityConfig build ()

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

Returns
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
public WifiAwareDataPathSecurityConfig.Builder setPmk (byte[] pmk)

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 byte: 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.

Returns
WifiAwareDataPathSecurityConfig.Builder the current Builder builder, enabling chaining of builder methods. This value cannot be null.

setPmkId

Added in API level 33
public WifiAwareDataPathSecurityConfig.Builder setPmkId (byte[] pmkId)

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 byte: 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.

Returns
WifiAwareDataPathSecurityConfig.Builder the current Builder builder, enabling chaining of builder methods. This value cannot be null.

setPskPassphrase

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

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.

Returns
WifiAwareDataPathSecurityConfig.Builder the current Builder builder, enabling chaining of builder methods. This value cannot be null.