Skip to content

createSubIdentity

@JvmOverloads

fun createSubIdentity(deviceName: String = "", privateKeys: PreGeneratedKeys? = null, expireAfter: Duration = Duration.ofDays(365 * 5)): CreateSubIdentityResponse

Create a new sub-identity, or new device, for the current user account. After creating this new device, you will probably want to call SealdSDK.massReencrypt, so that the newly created device will be able to decrypt EncryptionSessions previously created for this account.

Return

A CreateSubIdentityResponse instance, containing deviceId (the ID of the newly created device) and backupKey (the identity export of the newly created sub-identity).

Parameters

deviceNameAn optional name for the device to create. This is metadata, useful on the Seald Dashboard for recognizing this device. Optional.
privateKeysOptional. Pre-generated private keys, returned by a call to generatePrivateKeys or generatePrivateKeysAsync.
expireAfterThe duration during which the device key for the device to create will be valid without renewal. Optional, defaults to 5 years.

Throws

SealdException