recoverKeyPairs method
Future<RecoveryResult<Map<String, Map<CardinalRsaPublicKey, CardinalRsaPrivateKey> > > >
recoverKeyPairs(
- String sdkId,
- RecoveryDataKey recoveryKey,
- bool autoDelete
Implementation
Future<RecoveryResult<Map<String, Map<CardinalRsaPublicKey, CardinalRsaPrivateKey>>>> recoverKeyPairs(String sdkId, RecoveryDataKey recoveryKey, bool autoDelete) async {
final res = await _methodChannel.invokeMethod<String>(
'RecoveryApi.recoverKeyPairs',
{
"sdkId": sdkId,
"recoveryKey": jsonEncode(RecoveryDataKey.encode(recoveryKey)),
"autoDelete": jsonEncode(autoDelete),
}
).catchError(convertPlatformException);
if (res == null) throw AssertionError("received null result from platform method recoverKeyPairs");
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)))));
},
);
}