SealdSdk_CreateAccount method

int SealdSdk_CreateAccount(
  1. Pointer<NativeSealdSdk> sealdSdk,
  2. Pointer<Utf8> displayName,
  3. Pointer<Utf8> deviceName,
  4. Pointer<Utf8> signupJwt,
  5. int expireAfter,
  6. Pointer<Utf8> preGeneratedEncryptionKey,
  7. Pointer<Utf8> preGeneratedSigningKey,
  8. Pointer<Pointer<NativeSealdAccountInfo>> result,
  9. Pointer<Pointer<NativeSealdError>> error,
)

Create a new Seald SDK Account for this Seald SDK instance. This function can only be called if the current SDK instance does not have an account yet.

@param sealdSdk The SealdSdk instance. @param displayName A name for the user to create. This is metadata, useful on the Seald Dashboard for recognizing this user. @param deviceName A name for the device to create. This is metadata, useful on the Seald Dashboard for recognizing this device. @param signupJwt The JWT to allow this SDK instance to create an account. @param expireAfter The duration during which the created device key will be valid without renewal, in Milliseconds. Optional, defaults to 5 years. @param preGeneratedEncryptionKey A B64 encoding of a pre-generated key, or NULL. Either both must be passed, or neither. @param preGeneratedSigningKey A B64 encoding of a pre-generated key, or NULL. Either both must be passed, or neither. @param result A pointer to SealdAccountInfo*, to store a SealdAccountInfo instance containing the Seald ID of the newly created Seald user, the device ID, and the date at which the current device keys will expire. @param error A pointer to a SealdError* where details will be stored in case of error. @return Error code: -1 if an error happened, 0 for success.

Implementation

int SealdSdk_CreateAccount(
  ffi.Pointer<NativeSealdSdk> sealdSdk,
  ffi.Pointer<pkg_ffi.Utf8> displayName,
  ffi.Pointer<pkg_ffi.Utf8> deviceName,
  ffi.Pointer<pkg_ffi.Utf8> signupJwt,
  int expireAfter,
  ffi.Pointer<pkg_ffi.Utf8> preGeneratedEncryptionKey,
  ffi.Pointer<pkg_ffi.Utf8> preGeneratedSigningKey,
  ffi.Pointer<ffi.Pointer<NativeSealdAccountInfo>> result,
  ffi.Pointer<ffi.Pointer<NativeSealdError>> error,
) {
  return _SealdSdk_CreateAccount(
    sealdSdk,
    displayName,
    deviceName,
    signupJwt,
    expireAfter,
    preGeneratedEncryptionKey,
    preGeneratedSigningKey,
    result,
    error,
  );
}