One Logo Pool Ball
WiFiAware · IOS API REFERENCE

WASharedSecret

struct · iOS 26.4+ · SDK 27.1

struct WASharedSecret

A high-entropy shared secret unique to this network connection, which can be used to pair and setup security for higher layer network protocols like TLS, QUIC or IPSec without requiring manual action or data entry by a user. The shared secret can be used to authenticate a [PAKE](https://en.wikipedia.org/wiki/Password-authenticated_key_agreement) like SPAKE2, which is then used to pair and derive long-term asymmetric keys for authentication and encryption of the upper-layer network protocol. Both sides of a connection will derive the same shared secret value if the same connection and input parameters are used: - Your app and a remote app can derive the same shared secret value by calling the ``WiFiAware/WAConnection/deriveSharedSecret(for:method:context:)`` function on the same connection, with the same parameters. - Devices and accessories can derive the same value as your app by using the derivation specified in the Wi-Fi Aware 5.0 standard, and providing the same parameters as used by your app. Example Usage to get a shared secret: ```swift let secret = await connection.wifiAware?.deriveSharedSecret(for: .tlsPSK, method: .kdfHash256) ``` >Important: If needed, get a new shared secret for each new network connection. Do not save this value, send it to other devices, reuse it across connections, or use it as a long-term authentication or encryption key. Instead, use this to pair higher layer protocols, and derive unique longer-term asymmetric keys for those protocols when pairing them.

Members (2)

get · iOS 26.4+

derivation

TypeScript
get derivation(): WASharedSecret_DerivationMethod
Swift declaration
let derivation: WASharedSecret.DerivationMethod

The method used to derive the shared secret on both sides of the connection, as per the Wi-Fi Aware standard.

get · iOS 26.4+

data

TypeScript
get data(): ArrayBuffer
Swift declaration
let data: Data

The secret data that is derived by both this device and the remote device for this connection.

Skipped declarations

No declarations were skipped in this snapshot.

All WiFiAware types →