recoverKeyPairsWaitingForCreation method

Future<RecoveryResult<Map<String, Map<CardinalRsaPublicKey, CardinalRsaPrivateKey>>>> recoverKeyPairsWaitingForCreation(
  1. int cancellationToken,
  2. String sdkId,
  3. RecoveryDataKey recoveryKey,
  4. bool autoDelete,
  5. int waitSeconds,
)

Implementation

Future<RecoveryResult<Map<String, Map<CardinalRsaPublicKey, CardinalRsaPrivateKey>>>> recoverKeyPairsWaitingForCreation(int cancellationToken, String sdkId, RecoveryDataKey recoveryKey, bool autoDelete, int waitSeconds) async {
	final res = await _methodChannel.invokeMethod<String>(
		'RecoveryApi.recoverKeyPairsWaitingForCreation',
		{
			"cancellationToken": cancellationToken.toString(),
			"sdkId": sdkId,
			"recoveryKey": jsonEncode(RecoveryDataKey.encode(recoveryKey)),
			"autoDelete": jsonEncode(autoDelete),
			"waitSeconds": jsonEncode(waitSeconds),
		}
	).catchError(convertPlatformException);
	if (res == null) throw AssertionError("received null result from platform method recoverKeyPairsWaitingForCreation");
	final parsedResJson = jsonDecode(res);
	return RecoveryResult.fromJSON(
		parsedResJson,
		(x1) {
			return (x1 as Map<String, dynamic>).map((k2, v2) => MapEntry((k2 as String), (v2 as Map<String, dynamic>).map((k3, v3) => MapEntry(CardinalRsaPublicKey.fromSpkiHex(k3), CardinalRsaPrivateKey.fromPkcs8Base64(v3)))));
		},
	);
}