saveIdentityFromRawKeysAsync method

Future<String> saveIdentityFromRawKeysAsync(
  1. String userId,
  2. String rawStorageKey,
  3. Uint8List rawEncryptionKey,
  4. Uint8List identity,
)

Save the given identity for the given userId, encrypted with the given raw keys.

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. identity - The identity to save.

Returns the SSKS ID of the stored identity, which can be used by your backend to manage it.

Implementation

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