retrieveEncryptionSessionByTmrAsync method

Future<SealdEncryptionSession> retrieveEncryptionSessionByTmrAsync(
  1. String tmrJWT,
  2. String sessionId,
  3. Uint8List overEncryptionKey, {
  4. SealdTmrAccessesRetrievalFilters? tmrAccessesFilters,
  5. bool tryIfMultiple = true,
  6. bool useCache = true,
})

Retrieve an encryption session with a TMR access JWT.

tmrJWT - The TMR JWT. sessionId - The ID of the session to retrieve. overEncryptionKey - The TMR over-encryption key. This MUST be a cryptographically random buffer of 64 bytes. tmrAccessesFilters - Retrieval tmr accesses filters. If multiple TMR Accesses for this session are associated with the auth factor, filter out the unwanted ones. tryIfMultiple - If multiple accesses are found for this session associated with the auth factor, whether or not to loop over all of them to find the wanted one. useCache - Whether or not to use the cache (if enabled globally). Returns the retrieved SealdEncryptionSession instance.

Implementation

Future<SealdEncryptionSession> retrieveEncryptionSessionByTmrAsync(
    String tmrJWT, String sessionId, Uint8List overEncryptionKey,
    {SealdTmrAccessesRetrievalFilters? tmrAccessesFilters,
    bool tryIfMultiple = true,
    bool useCache = true}) async {
  final _TransferablePointer<NativeSealdEncryptionSession> res =
      await compute(
          (Map<String, dynamic> args) => _retrieveEncryptionSessionByTmr(
              args["tmrJWT"], args["sessionId"], args["overEncryptionKey"],
              tmrAccessesFilters: args["tmrAccessesFilters"],
              tryIfMultiple: args["tryIfMultiple"],
              useCache: args["useCache"]),
          {
        "tmrJWT": tmrJWT,
        "sessionId": sessionId,
        "overEncryptionKey": overEncryptionKey,
        "tmrAccessesFilters": tmrAccessesFilters,
        "tryIfMultiple": tryIfMultiple,
        "useCache": useCache
      });
  return SealdEncryptionSession._fromC(res.pointer());
}