waitForRecoveryKey method
Future<RecoveryResult<Map<String, Map<CardinalRsaPublicKey, CardinalRsaPrivateKey> > > >
waitForRecoveryKey(
- String referenceId,
- RecoveryDataKey recoveryKey,
- bool autoDelete,
- int waitSeconds,
- int cancellationToken,
override
Implementation
@override
Future<RecoveryResult<Map<String, Map<CardinalRsaPublicKey, CardinalRsaPrivateKey>>>> waitForRecoveryKey(
String referenceId,
RecoveryDataKey recoveryKey,
bool autoDelete,
int waitSeconds,
int cancellationToken
) async {
final res = await _methodChannel.invokeMethod<String>(
'KeyPairRecoverer.waitForRecoveryKey',
{
"cancellationToken": cancellationToken.toString(),
"referenceId": referenceId,
"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)
))
));
},
);
}