Implementation
static Future<BaseKeyProvider> create({
bool sharedKey = true,
String? ratchetSalt,
String? uncryptedMagicBytes,
int? ratchetWindowSize,
int? failureTolerance,
}) async {
rtc.KeyProviderOptions options = rtc.KeyProviderOptions(
sharedKey: sharedKey,
ratchetSalt:
Uint8List.fromList((ratchetSalt ?? defaultRatchetSalt).codeUnits),
ratchetWindowSize: ratchetWindowSize ?? defaultRatchetWindowSize,
uncryptedMagicBytes: Uint8List.fromList(
(uncryptedMagicBytes ?? defaultMagicBytes).codeUnits),
failureTolerance: failureTolerance ?? defaultFailureTolerance,
);
final keyProvider =
await rtc.frameCryptorFactory.createDefaultKeyProvider(options);
return BaseKeyProvider(keyProvider, options);
}