Function deriveCredentials

  • Derives ICE credentials from a DTLS fingerprint using HKDF-SHA256

    Parameters

    • fingerprint: Uint8Array

      32-byte DTLS fingerprint (SHA-256 of certificate)

    Returns Promise<IceCredentials>

    ICE credentials (ufrag and pwd)

    const fingerprint = extractFingerprint(sdp);
    const credentials = await deriveCredentials(fingerprint);
    console.log(credentials.ufrag); // "ejxenw"
    console.log(credentials.pwd); // "TS6KfB2mN9pQ3rS7wX"