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

Deprecated

Use KeystoreInterface instead

interface Keystore {
    createAuthToken(req): Promise<Token>;
    createInvite(req): Promise<CreateInviteResponse>;
    decryptV1(req): Promise<DecryptResponse>;
    decryptV2(req): Promise<DecryptResponse>;
    encryptV1(req): Promise<EncryptResponse>;
    encryptV2(req): Promise<EncryptResponse>;
    getAccountAddress(): Promise<string>;
    getPrivateKeyBundle(): Promise<PrivateKeyBundleV1>;
    getPrivatePreferencesTopicIdentifier(): Promise<GetPrivatePreferencesTopicIdentifierResponse>;
    getPublicKeyBundle(): Promise<PublicKeyBundle>;
    getRefreshJob(req): Promise<GetRefreshJobResponse>;
    getV1Conversations(): Promise<GetConversationsResponse>;
    getV2ConversationHmacKeys(): Promise<GetConversationHmacKeysResponse>;
    getV2Conversations(): Promise<GetConversationsResponse>;
    saveInvites(req): Promise<SaveInvitesResponse>;
    saveV1Conversations(req): Promise<SaveV1ConversationsResponse>;
    selfDecrypt(req): Promise<DecryptResponse>;
    selfEncrypt(req): Promise<SelfEncryptResponse>;
    setRefreshJob(req): Promise<SetRefreshJobResponse>;
    signDigest(req): Promise<Signature>;
}

Methods

  • 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

    • req: CreateInviteRequest

    Returns Promise<CreateInviteResponse>

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

    Returns Promise<PrivateKeyBundleV1>

  • Get the private preferences topic identifier

    Returns Promise<GetPrivatePreferencesTopicIdentifierResponse>

  • Returns the conversation HMAC keys for the current, previous, and next 30 day periods since the epoch

    Returns Promise<GetConversationHmacKeysResponse>

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

    Parameters

    • req: SaveInvitesRequest

    Returns Promise<SaveInvitesResponse>

  • Save V1 Conversations

    Parameters

    • req: SaveV1ConversationsRequest

    Returns Promise<SaveV1ConversationsResponse>