SealdSsksPasswordPlugin_RetrieveIdentityFromRawKeys method
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.
@param passwordPlugin The SSKS Password plugin instance.
@param userId The ID of the userId.
@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 retrievedIdentity A pointer where to store the retrieved identity.
@param retrievedIdentityLen A pointer where to store the length of the retrieved identity.
@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_RetrieveIdentityFromRawKeys(
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.Pointer<ffi.Uint8>> retrievedIdentity,
ffi.Pointer<ffi.Int> retrievedIdentityLen,
ffi.Pointer<ffi.Pointer<NativeSealdError>> error,
) {
return _SealdSsksPasswordPlugin_RetrieveIdentityFromRawKeys(
passwordPlugin,
userId,
rawStorageKey,
rawEncryptionKey,
rawEncryptionKeyLen,
retrievedIdentity,
retrievedIdentityLen,
error,
);
}