NativeDtlsEngine.encryptAlertRecord

private ubyte[] encryptAlertRecord(DtlsPeerState state, TlsAead aead, const(ubyte)[] alertPayload)

Encrypt an alert record payload using the peer's write AEAD.

Uses the same encryption format as application data for the negotiated DTLS version (1.2 explicit nonce, 1.3 XOR nonce).

Parameters

stateThe peer state (for epoch, sequence, version).
aeadThe write AEAD cipher.
alertPayloadThe 2-byte alert (level + description).

Returns

Complete encrypted DTLS alert record.