retrieveIdentityFromRawKeysAsync method

Future<Uint8List> retrieveIdentityFromRawKeysAsync(
  1. String userId,
  2. String rawStorageKey,
  3. Uint8List rawEncryptionKey
)

Retrieve the identity stored on the SSKS server for the given userId, and decrypt it with the given raw keys.

If you use an incorrect password multiple times, the server may throttle your requests. In this case, you will receive an error Request throttled, retry after {N}s, with {N} the number of seconds during which you cannot try again.

userId - The ID of the user. rawStorageKey - The key under which identity keys are stored. This MUST be a secret known only to this user of your app, and never to other users, as learning it will allow deleting the stored identities. Useful to change if you want to store multiple identities for the same userId. Allowed characters : A-Za-z0-9+/=-_@.. Max length is 256 characters. rawEncryptionKey - The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random buffer of 64 bytes.

Returns a Uint8List containing the retrieved identity.

Implementation

Future<Uint8List> retrieveIdentityFromRawKeysAsync(
    String userId, String rawStorageKey, Uint8List rawEncryptionKey) {
  final _TransferablePointer<NativeSealdSsksPasswordPlugin> tPtr = _ptr;
  return compute(
      (Map<String, dynamic> args) => SealdSsksPasswordPlugin._(tPtr)
          .retrieveIdentityFromRawKeys(args["userId"], args["rawStorageKey"],
              args["rawEncryptionKey"]),
      {
        "userId": userId,
        "rawStorageKey": rawStorageKey,
        "rawEncryptionKey": rawEncryptionKey
      });
}