Skip to content

Interface: SSKSPassword

Contents

Properties

keyStorageURL

keyStorageURL: string

keyStorageURL with which this plugin instance was created. URL of the SSKS Identity Key Storage to which it should connect.


keyStore

keyStore: KeyStorePassword

Manual SSKS Identity Key Storage interface. For advanced use.

Methods

changeIdentityPassword()

changeIdentityPassword(args): Promise<string>

Change the password of a Seald account.

Warning: this will change the SSKS ID of the stored identity. Returns the new SSKS ID of the stored identity, or null if the password was not changed (in case newPassword === currentPassword).

Parameters

args: Object

args.currentPassword: string

The user's current password.

args.newPassword: string

The next password

args.userId: string

The unique ID of the current user inside your app. It will be used to identify this user. Max 64 characters long.

Returns

Promise<string>


retrieveIdentity()

retrieveIdentity(args): Promise<AccountInfo>

Retrieve the Seald account previously created with initiateIdentity.

You must either pass the password argument, or both rawStorageKey and rawEncryptionKey.

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.

Parameters

args: Object

args.password?: string

The user's password. It will be used to encrypt / decrypt the stored identity keys. You must set either the password argument, or both rawStorageKey and rawEncryptionKey.

args.rawEncryptionKey?: string

The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be the Base64 string encoding of a cryptographically random buffer of 64 bytes. You must set either the password argument, or both rawStorageKey and rawEncryptionKey.

args.rawStorageKey?: string

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. You must set either the password argument, or both rawStorageKey and rawEncryptionKey.

args.userId: string

The unique ID of the current user inside your app. It will be used to identify this user. Max 64 characters long.

Returns

Promise<AccountInfo>


saveIdentity()

saveIdentity(args): Promise<string>

Save the Seald account to SSKS.

You must either pass the password argument, or both rawStorageKey and rawEncryptionKey.

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

Parameters

args: Object

args.identity?: ArrayBuffer | Uint8Array | Buffer

Optional, the identity to save. If no identity is given, current one is saved.

args.password?: string

The user's password. It will be used to encrypt / decrypt the stored identity keys. You must set either the password argument, or both rawStorageKey and rawEncryptionKey.

args.rawEncryptionKey?: string

The raw encryption key used to encrypt / decrypt the stored identity keys. This MUST be the Base64 string encoding of a cryptographically random buffer of 64 bytes. You must set either the password argument, or both rawStorageKey and rawEncryptionKey.

args.rawStorageKey?: string

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. You must set either the password argument, or both rawStorageKey and rawEncryptionKey.

args.userId: string

The unique ID of the current user inside your app. It will be used to identify this user. Max 64 characters long.

Returns

Promise<string>