create static method

Future<BaseKeyProvider> create(
  1. {bool sharedKey = true,
  2. String? ratchetSalt,
  3. String? uncryptedMagicBytes,
  4. int? ratchetWindowSize,
  5. int? failureTolerance}
)

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);
}