Skip to content

Commit 51e1279

Browse files
authored
Feat/add more frame cryptor api (#21)
* add more frame cryptor api. * bump version.
1 parent 359f64b commit 51e1279

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

33
--------------------------------------------
4+
[1.1.2] - 2023-09-14
5+
6+
* Add more frame cryptor api.
7+
48
[1.1.1] - 2023-08-14
59

610
* Add more async methods.

lib/src/frame_cryptor.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,21 @@ class KeyProviderOptions {
1515
required this.ratchetSalt,
1616
required this.ratchetWindowSize,
1717
this.uncryptedMagicBytes,
18+
this.failureTolerance = -1,
1819
});
1920
bool sharedKey;
2021
Uint8List ratchetSalt;
2122
Uint8List? uncryptedMagicBytes;
2223
int ratchetWindowSize;
24+
int failureTolerance;
2325
Map<String, dynamic> toJson() {
2426
return {
2527
'sharedKey': sharedKey,
2628
'ratchetSalt': ratchetSalt,
2729
if (uncryptedMagicBytes != null)
2830
'uncryptedMagicBytes': uncryptedMagicBytes,
2931
'ratchetWindowSize': ratchetWindowSize,
32+
'failureTolerance': failureTolerance,
3033
};
3134
}
3235
}
@@ -36,6 +39,15 @@ abstract class KeyProvider {
3639
/// The unique identifier of the key provider.
3740
String get id;
3841

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+
3951
/// Set the raw key at the given index.
4052
Future<bool> setKey({
4153
required String participantId,
@@ -49,6 +61,15 @@ abstract class KeyProvider {
4961
required int index,
5062
});
5163

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+
5273
/// Dispose the key manager.
5374
Future<void> dispose();
5475
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: webrtc_interface
22
description: WebRTC Interface for Dart-Web/Flutter.
3-
version: 1.1.1
3+
version: 1.1.2
44
homepage: https://flutter-webrtc.org
55

66
environment:

0 commit comments

Comments
 (0)