waitForRecoveryKey method

CancellableFuture<RecoveryResult<Map<String, Map<CardinalRsaPublicKey, CardinalRsaPrivateKey>>>> waitForRecoveryKey(
  1. RecoveryDataKey recoveryKey,
  2. bool autoDelete,
  3. int waitSeconds
)

Equivalent to recoverWithRecoveryKey except that if there is no recovery data for the provided key it waits for up to waitSeconds seconds for it to be created. If the data wasn't created within the provided time frame this method will return a RecoveryResult.Failure result with RecoveryDataUseFailureReason.Missing at the end of the waiting period.

Implementation

CancellableFuture<RecoveryResult<Map<String, Map<CardinalRsaPublicKey, CardinalRsaPrivateKey>>>> waitForRecoveryKey(
  RecoveryDataKey recoveryKey,
  bool autoDelete,
  int waitSeconds
) {
  final cancellationToken = CancellationTokenProvider.getNextToken();
  return CancellableFuture.internalConstructor(
      CardinalSdkPlatformInterface.instance.crypto.waitForRecoveryKey(
        _nativeInstanceId,
        recoveryKey,
        autoDelete,
        waitSeconds,
        cancellationToken,
      ),
      cancellationToken
  );
}