/** * Carrier-style TURN credential derivation. * * Ported verbatim from the C SDK: * ~/blockchain/ela/Elastos.NET.Carrier.Native.SDK/src/carrier/carrier_turnserver.c * * Every Carrier bootnode runs a TURN server on UDP/3478 with this exact * authentication scheme. Credentials are derived per request from a * freshly generated nonce and the ECDH shared key between our identity * keypair and the bootnode's identity public key: * * shared_key = nacl.box.before(bootnode_pk, our_sk) // X25519 * nonce = 24 random bytes * digest = HMAC-SHA256(shared_key, nonce) * username = "{ourUserid}@{base58(nonce)}.auth.tox" * password = base58(digest) * realm = "elastos.org" * * The bootnode's TURN process knows its own secret key, can therefore * compute the same shared_key, reads `nonce` out of the username, and * recomputes the HMAC to verify our password. */ export declare const CARRIER_TURN_PORT = 3478; export declare const CARRIER_TURN_REALM = "elastos.org"; export declare const CARRIER_TURN_USER_SUFFIX = "auth.tox"; export interface CarrierTurnCreds { host: string; port: number; realm: string; username: string; password: string; } export declare function deriveCarrierTurnCreds(opts: { bootnodeHost: string; bootnodePublicKey: Uint8Array; ourUserid: string; ourSecretKey: Uint8Array; }): CarrierTurnCreds;