Skip to content

saveIdentityFromRawKeys

fun saveIdentityFromRawKeys(userId: String, rawStorageKey: String, rawEncryptionKey: ByteArray, identity: ByteArray): String

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

Return

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

Parameters

userIdThe ID of the userId.
rawStorageKeyThe 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.
rawEncryptionKeyThe raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be a cryptographically random buffer of 64 bytes.
identityThe identity to save.

Throws

SealdException