retrieveEncryptionSessionAsync method

Future<SealdEncryptionSession> retrieveEncryptionSessionAsync({
  1. String? sessionId,
  2. String? message,
  3. String? filePath,
  4. Uint8List? fileBytes,
  5. bool useCache = true,
  6. bool lookupProxyKey = false,
  7. bool lookupGroupKey = true,
})

Retrieve an encryption session, and returns the associated SealdEncryptionSession instance, with which you can then encrypt/decrypt multiple messages.

sessionId - The ID of the session to retrieve. message - Any message belonging to the session to retrieve. filePath - The path to an encrypted file belonging to the session to retrieve. fileBytes - The bytes of an encrypted file belonging to the session to retrieve. useCache - Whether or not to use the cache (if enabled globally). lookupProxyKey - Whether or not to try retrieving the session via a proxy. lookupGroupKey - Whether or not to try retrieving the session via a group. Returns the retrieved SealdEncryptionSession instance.

Implementation

Future<SealdEncryptionSession> retrieveEncryptionSessionAsync(
    {String? sessionId,
    String? message,
    String? filePath,
    Uint8List? fileBytes,
    bool useCache = true,
    bool lookupProxyKey = false,
    bool lookupGroupKey = true}) async {
  final _TransferablePointer<NativeSealdEncryptionSession> res =
      await compute(
          (Map<String, dynamic> args) => _retrieveEncryptionSession(
              fileBytes: args["fileBytes"],
              sessionId: args["sessionId"],
              message: args["message"],
              filePath: args["filePath"],
              useCache: args["useCache"],
              lookupProxyKey: args["lookupProxyKey"],
              lookupGroupKey: args["lookupGroupKey"]),
          {
        "sessionId": sessionId,
        "message": message,
        "filePath": filePath,
        "fileBytes": fileBytes,
        "useCache": useCache,
        "lookupProxyKey": lookupProxyKey,
        "lookupGroupKey": lookupGroupKey
      });
  return SealdEncryptionSession._fromC(res.pointer());
}