LCOV - code coverage report
Current view: top level - lib/src/voip/models - key_provider.dart (source / functions) Hit Total Coverage
Test: merged.info Lines: 0 19 0.0 %
Date: 2024-09-04 20:26:16 Functions: 0 0 -

          Line data    Source code
       1             : import 'dart:typed_data';
       2             : 
       3             : import 'package:matrix/matrix.dart';
       4             : 
       5             : enum E2EEKeyMode {
       6             :   kNone,
       7             :   kSharedKey,
       8             :   kPerParticipant,
       9             : }
      10             : 
      11             : abstract class EncryptionKeyProvider {
      12             :   Future<void> onSetEncryptionKey(
      13             :       CallParticipant participant, Uint8List key, int index);
      14             : 
      15             :   Future<Uint8List> onRatchetKey(CallParticipant participant, int index);
      16             : 
      17             :   Future<Uint8List> onExportKey(CallParticipant participant, int index);
      18             : }
      19             : 
      20             : class EncryptionKeyEntry {
      21             :   final int index;
      22             :   final String key;
      23           0 :   EncryptionKeyEntry(this.index, this.key);
      24             : 
      25           0 :   factory EncryptionKeyEntry.fromJson(Map<String, dynamic> json) =>
      26           0 :       EncryptionKeyEntry(
      27           0 :         json['index'] as int,
      28           0 :         json['key'] as String,
      29             :       );
      30             : 
      31           0 :   Map<String, dynamic> toJson() => {
      32           0 :         'index': index,
      33           0 :         'key': key,
      34             :       };
      35             : }
      36             : 
      37             : class EncryptionKeysEventContent {
      38             :   // Get the participant info from todevice message params
      39             :   final List<EncryptionKeyEntry> keys;
      40             :   final String callId;
      41           0 :   EncryptionKeysEventContent(this.keys, this.callId);
      42             : 
      43           0 :   factory EncryptionKeysEventContent.fromJson(Map<String, dynamic> json) =>
      44           0 :       EncryptionKeysEventContent(
      45           0 :           (json['keys'] as List<dynamic>)
      46           0 :               .map(
      47           0 :                   (e) => EncryptionKeyEntry.fromJson(e as Map<String, dynamic>))
      48           0 :               .toList(),
      49           0 :           json['call_id'] as String);
      50             : 
      51           0 :   Map<String, dynamic> toJson() => {
      52           0 :         'keys': keys.map((e) => e.toJson()).toList(),
      53           0 :         'call_id': callId,
      54             :       };
      55             : }

Generated by: LCOV version 1.14