saveIdentityAsync method

Future<SealdSsksTMRPluginSaveIdentityResponse> saveIdentityAsync(
  1. String sessionId,
  2. String authFactorType,
  3. String authFactorValue,
  4. Uint8List rawTMRSymKey,
  5. Uint8List identity, {
  6. String? challenge,
})

Save the Seald account to SSKS.

sessionId - The user's session ID. authFactorType - The type of authentication factor. Can be "EM" or "SMS". authFactorValue - The value of authentication factor. rawTMRSymKey - 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. challenge - The challenge sent by SSKS to the user's authentication method.

Returns a SealdSsksTMRPluginSaveIdentityResponse containing the SSKS ID of the stored identity.

Implementation

Future<SealdSsksTMRPluginSaveIdentityResponse> saveIdentityAsync(
    String sessionId,
    String authFactorType,
    String authFactorValue,
    Uint8List rawTMRSymKey,
    Uint8List identity,
    {String? challenge}) {
  final _TransferablePointer<NativeSealdSsksTMRPlugin> tPtr = _ptr;
  return compute(
      (Map<String, dynamic> args) => SealdSsksTMRPlugin._(tPtr).saveIdentity(
            args["sessionId"],
            args["authFactorType"],
            args["authFactorValue"],
            args["rawTMRSymKey"],
            args["identity"],
            challenge: args["challenge"],
          ),
      {
        "sessionId": sessionId,
        "authFactorType": authFactorType,
        "authFactorValue": authFactorValue,
        "rawTMRSymKey": rawTMRSymKey,
        "identity": identity,
        "challenge": challenge
      });
}