addMultipleTmrAccesses method

Map<String, SealdActionStatus> addMultipleTmrAccesses(
  1. List<SealdTmrRecipientWithRights> recipients
)

Add multiple TMR accesses to this session for the given authentication factors.

recipients - The TMR recipients with their associated rights. Returns a Map which gives the result of the adding as a SealdActionStatus for each of the added TMR recipients.

Implementation

Map<String, SealdActionStatus> addMultipleTmrAccesses(
    List<SealdTmrRecipientWithRights> recipients) {
  final Pointer<NativeSealdTmrRecipientsWithRightsArray> nativeRecipients =
      SealdTmrRecipientWithRights._toCArray(recipients);

  final Pointer<Pointer<NativeSealdActionStatusArray>> result =
      calloc<Pointer<NativeSealdActionStatusArray>>();
  final Pointer<Pointer<NativeSealdError>> err =
      calloc<Pointer<NativeSealdError>>();

  final int resultCode =
      _bindings.SealdEncryptionSession_AddMultipleTmrAccesses(
          _ptr.pointer(), nativeRecipients, result, err);

  _bindings.SealdTmrRecipientsWithRightsArray_Free(nativeRecipients);

  if (resultCode != 0) {
    calloc.free(result);
    throw SealdException._fromCPtr(err);
  } else {
    final Map<String, SealdActionStatus> res =
        SealdActionStatus._fromCArray(result.value);
    calloc.free(result);
    calloc.free(err);
    return res;
  }
}