recoverWithRecoveryKey method

Future<RecoveryResult<Map<String, Map<CardinalRsaPublicKey, CardinalRsaPrivateKey>>>> recoverWithRecoveryKey(
  1. RecoveryDataKey recoveryKey,
  2. bool autoDelete
)

Recover a keypair using a recovery key created in the past using the {@link IccRecoveryXApi.createRecoveryInfoForAvailableKeyPairs} method. @param recoveryKey the result of a past call to {@link IccRecoveryXApi.createRecoveryInfoForAvailableKeyPairs}. @param autoDelete if true, the recovery data will be deleted from the server after it could be used successfully. This will prevent the recovery key from being used again. @return a recovery result, which, if successful, contains a map dataOwnerId -> publicKeySpki -> keyPair, where:

  • The dataOwnerId keys are the ids of the data owner which created the recovery data and his parents, if the recovery data contains also the parents keys
  • The publicKeySpki keys are all recovered public key pairs for the data owner, in hex-encoded spki format (full, no fingerprint). Usually these are all the keys if the recovery data was created after the latest key for the user.
  • The keyPair is the imported privateKey + publicKey.

Implementation

Future<RecoveryResult<Map<String, Map<CardinalRsaPublicKey, CardinalRsaPrivateKey>>>> recoverWithRecoveryKey(
  RecoveryDataKey recoveryKey,
  bool autoDelete
) async {
  return await CardinalSdkPlatformInterface.instance.crypto.recoverWithRecoveryKey(
    _nativeInstanceId,
    recoveryKey,
    autoDelete,
  );
}