Skip to content

Interface: SSKS2MR

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: KeyStore2MR

Manual SSKS Identity Key Storage interface. For advanced use.

Methods

retrieveIdentity()

retrieveIdentity(args): Promise<AccountInfo>

Retrieve the Seald account previously created with initiateIdentity.

If the identity has been stored without no challenge, the first time the identity is retrieved afterwards, the keys of the identity in question are automatically renewed and stored again onto SSKS. If the same identity is also stored elsewhere (for example with @seald-io/sdk-plugin-ssks-password), you will have to save it again.

It is recommended not to retrieve the same identity with ssks2MR.retrieveIdentity on multiple devices at the same time, at the same exact instant, for example during automated tests. Please wait until one of the devices has finished retrieving the identity before starting the retrieval on another device.

Parameters

args: Object

args.authFactor?: AuthFactor

Authentication method of this user, to which SSKS has sent a challenge at the request of your app's server.

args.challenge: string

Challenge sent by SSKS to the user's authentication method.

args.email?: string

Deprecated: Email of this user, to which SSKS has sent a challenge email at the request of your app's server.

args.rawTwoManRuleKey?: 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 twoManRuleKey argument, or rawTwoManRuleKey.

args.sessionId: string

Session ID given by SSKS to your app's server.

args.twoManRuleKey?: string

Secret stored by your app's server for securing this user's identity. You must set either the twoManRuleKey argument, or rawTwoManRuleKey.

args.userId: string

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

Returns

Promise<AccountInfo>


saveIdentity()

saveIdentity(args): Promise<string>

Save the Seald account to SSKS.

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

Parameters

args: Object

args.authFactor?: AuthFactor

Authentication method of this user, to which SSKS has sent a challenge at the request of your app's server.

args.challenge?: string

Optional. If the server responded with must_authenticate to true, this is the challenge sent by SSKS to the user's authentication method.

args.email?: string

Deprecated: Email of this user, to which SSKS has sent a challenge email at the request of your app's server.

args.identity?: Buffer

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

args.rawTwoManRuleKey?: 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 twoManRuleKey argument, or rawTwoManRuleKey.

args.sessionId: string

Session ID given by SSKS to your app's server.

args.twoManRuleKey?: string

Secret stored by your app's server for securing this user's identity. You must set either the twoManRuleKey argument, or rawTwoManRuleKey.

args.userId: string

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

Returns

Promise<string>