@@ -15,18 +15,21 @@ class KeyProviderOptions {
15
15
required this .ratchetSalt,
16
16
required this .ratchetWindowSize,
17
17
this .uncryptedMagicBytes,
18
+ this .failureTolerance = - 1 ,
18
19
});
19
20
bool sharedKey;
20
21
Uint8List ratchetSalt;
21
22
Uint8List ? uncryptedMagicBytes;
22
23
int ratchetWindowSize;
24
+ int failureTolerance;
23
25
Map <String , dynamic > toJson () {
24
26
return {
25
27
'sharedKey' : sharedKey,
26
28
'ratchetSalt' : ratchetSalt,
27
29
if (uncryptedMagicBytes != null )
28
30
'uncryptedMagicBytes' : uncryptedMagicBytes,
29
31
'ratchetWindowSize' : ratchetWindowSize,
32
+ 'failureTolerance' : failureTolerance,
30
33
};
31
34
}
32
35
}
@@ -36,6 +39,15 @@ abstract class KeyProvider {
36
39
/// The unique identifier of the key provider.
37
40
String get id;
38
41
42
+ Future <void > setSharedKey ({required Uint8List key, int index = 0 }) =>
43
+ throw UnimplementedError ();
44
+
45
+ Future <Uint8List > ratchetSharedKey ({int index = 0 }) =>
46
+ throw UnimplementedError ();
47
+
48
+ Future <Uint8List > exportSharedKey ({int index = 0 }) =>
49
+ throw UnimplementedError ();
50
+
39
51
/// Set the raw key at the given index.
40
52
Future <bool > setKey ({
41
53
required String participantId,
@@ -49,6 +61,15 @@ abstract class KeyProvider {
49
61
required int index,
50
62
});
51
63
64
+ /// Export the key at the given index.
65
+ Future <Uint8List > exportKey ({
66
+ required String participantId,
67
+ required int index,
68
+ });
69
+
70
+ Future <void > setSifTrailer ({required Uint8List trailer}) =>
71
+ throw UnimplementedError ();
72
+
52
73
/// Dispose the key manager.
53
74
Future <void > dispose ();
54
75
}
0 commit comments