createEncryptionSessionAsync method

Future<SealdEncryptionSession> createEncryptionSessionAsync(
  1. List<SealdRecipientWithRights> recipients, {
  2. bool useCache = true,
})

Create an encryption session, and returns the associated SealdEncryptionSession instance, with which you can then encrypt/decrypt multiple messages. Warning: if you want to be able to retrieve the session later, you must put your own Seald ID in the recipients argument.

recipients - The Seald IDs of users who should be able to retrieve this session. useCache - Whether or not to use the cache (if enabled globally). Returns the created SealdEncryptionSession instance.

Implementation

Future<SealdEncryptionSession> createEncryptionSessionAsync(
    List<SealdRecipientWithRights> recipients,
    {bool useCache = true}) async {
  final _TransferablePointer<NativeSealdEncryptionSession> res =
      await compute(
          (Map<String, dynamic> args) => _createEncryptionSession(
              args["recipients"],
              useCache: args["useCache"]),
          {"recipients": recipients, "useCache": useCache});
  return SealdEncryptionSession._fromC(res.pointer());
}