Skip to main content

Keystore

Interface: Keystore

A Keystore is responsible for holding the user's XMTP private keys and using them to encrypt/decrypt/sign messages. Keystores are instantiated using a KeystoreProvider

Implemented by

Methods

createAuthToken

createAuthToken(req): Promise<Token>

Create an XMTP auth token to be used as a header on XMTP API requests

Parameters

NameType
reqCreateAuthTokenRequest

Returns

Promise<Token>

Defined in

keystore/interfaces.ts:48


createInvite

createInvite(req): Promise<CreateInviteResponse>

Create a sealed/encrypted invite and store the Topic keys in the Keystore for later use. The returned invite payload must be sent to the network for the other party to be able to communicate.

Parameters

NameType
reqCreateInviteRequest

Returns

Promise<CreateInviteResponse>

Defined in

keystore/interfaces.ts:42


decryptV1

decryptV1(req): Promise<DecryptResponse>

Decrypt a batch of V1 messages

Parameters

NameType
reqDecryptV1Request

Returns

Promise<DecryptResponse>

Defined in

keystore/interfaces.ts:19


decryptV2

decryptV2(req): Promise<DecryptResponse>

Decrypt a batch of V2 messages

Parameters

NameType
reqDecryptV2Request

Returns

Promise<DecryptResponse>

Defined in

keystore/interfaces.ts:23


encryptV1

encryptV1(req): Promise<EncryptResponse>

Encrypt a batch of V1 messages

Parameters

NameType
reqEncryptV1Request

Returns

Promise<EncryptResponse>

Defined in

keystore/interfaces.ts:27


encryptV2

encryptV2(req): Promise<EncryptResponse>

Encrypt a batch of V2 messages

Parameters

NameType
reqEncryptV2Request

Returns

Promise<EncryptResponse>

Defined in

keystore/interfaces.ts:31


getAccountAddress

getAccountAddress(): Promise<string>

Get the account address of the wallet used to create the Keystore

Returns

Promise<string>

Defined in

keystore/interfaces.ts:68


getPrivateKeyBundle

getPrivateKeyBundle(): Promise<PrivateKeyBundleV1>

Export the private keys. May throw an error if the keystore implementation does not allow this operation

Returns

Promise<PrivateKeyBundleV1>

Defined in

keystore/interfaces.ts:64


getPublicKeyBundle

getPublicKeyBundle(): Promise<PublicKeyBundle>

Get the PublicKeyBundle associated with the Keystore's private keys

Returns

Promise<PublicKeyBundle>

Defined in

keystore/interfaces.ts:60


getV2Conversations

getV2Conversations(): Promise<ConversationReference[]>

Get a list of V2 conversations

Returns

Promise<ConversationReference[]>

Defined in

keystore/interfaces.ts:56


saveInvites

saveInvites(req): Promise<SaveInvitesResponse>

Take a batch of invite messages and store the TopicKeys for later use in decrypting messages

Parameters

NameType
reqSaveInvitesRequest

Returns

Promise<SaveInvitesResponse>

Defined in

keystore/interfaces.ts:35


signDigest

signDigest(req): Promise<Signature>

Sign the provided digest with either the IdentityKey or a specified PreKey

Parameters

NameType
reqSignDigestRequest

Returns

Promise<Signature>

Defined in

keystore/interfaces.ts:52

Was the information on this page helpful?