NativeDtlsEngine.encryptAppData

private ubyte[] encryptAppData(DtlsPeerState state, TlsAead aead, const(ubyte)[] plaintext)

Encrypt application data into a DTLS record.

Handles the differences between DTLS 1.2 (explicit nonce) and DTLS 1.3 (XOR nonce) record encryption.

Parameters

stateThe peer state (for epoch and sequence number).
aeadThe write AEAD cipher.
plaintextApplication data to encrypt.

Returns

Complete DTLS record ready to send.