SealdSsksPasswordPlugin_SaveIdentityFromRawKeys method
Save the given identity for the given userId, encrypted with the given raw keys.
@param passwordPlugin The SSKS Password plugin instance.
@param userId The ID of the user.
@param 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.
@param rawEncryptionKey The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random buffer of 64 bytes.
@param rawEncryptionKeyLen The length of rawEncryptionKey.
@param identity The identity to save.
@param identityLen The length of identity.
@param result A pointer where to store the SSKS ID of the stored identity, which can be used by your backend to manage it.
@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 SealdSsksPasswordPlugin_SaveIdentityFromRawKeys(
ffi.Pointer<NativeSealdSsksPasswordPlugin> passwordPlugin,
ffi.Pointer<pkg_ffi.Utf8> userId,
ffi.Pointer<pkg_ffi.Utf8> rawStorageKey,
ffi.Pointer<ffi.Uint8> rawEncryptionKey,
int rawEncryptionKeyLen,
ffi.Pointer<ffi.Uint8> identity,
int identityLen,
ffi.Pointer<ffi.Pointer<pkg_ffi.Utf8>> result,
ffi.Pointer<ffi.Pointer<NativeSealdError>> error,
) {
return _SealdSsksPasswordPlugin_SaveIdentityFromRawKeys(
passwordPlugin,
userId,
rawStorageKey,
rawEncryptionKey,
rawEncryptionKeyLen,
identity,
identityLen,
result,
error,
);
}