Helpers for parsing and validating WhatsApp ADV (Account Device Verification) payloads.
Pair-success device-identity arrives as an ADVSignedDeviceIdentityHMAC
container in both Baileys and whatsmeow. The inner payload is an
ADVSignedDeviceIdentity.
Outbound message device-identity nodes and pair-success ACK payloads use the
direct ADVSignedDeviceIdentity bytes instead.
The methods below verify the pair-success HMAC using the stored ADV secret, validate the server account signature, and prepare the client device signature that must be echoed back to WhatsApp once pairing completes.
Summary
Types
Result returned by parse_signed_device_identity/3.
Functions
Encodes an ADVSignedDeviceIdentity payload.
Parses and validates a signed ADV device identity blob.
Types
Functions
Encodes an ADVSignedDeviceIdentity payload.
By default it includes accountSignatureKey (required for outgoing messages).
Pass include_signature_key: false for pair-device-sign payloads.
@spec parse_signed_device_identity(binary() | nil, binary(), identity_input()) :: {:ok, parsed_identity() | nil} | {:error, term()}
Parses and validates a signed ADV device identity blob.
The returned map exposes both the decoded structs and the serialized payload
that must be echoed back to the server (under :self_signed).