setKey method

  1. @override
Future<void> setKey(
  1. String key,
  2. {String? participantId,
  3. int? keyIndex}
)
override

Implementation

@override
Future<void> setKey(String key,
    {String? participantId, int? keyIndex}) async {
  if (options.sharedKey) {
    _sharedKey = Uint8List.fromList(key.codeUnits);
    return;
  }
  final keyInfo = KeyInfo(
    participantId: participantId ?? '',
    keyIndex: keyIndex ?? 0,
    key: Uint8List.fromList(key.codeUnits),
  );
  return _setKey(keyInfo);
}