A struct containing an open connection to a CryptoStore.

Opening the CryptoStore can take some time, due to the PBKDF calculation involved, so if multiple operations are being done on the same store, it is more efficient to open it once.

Methods

  • Returns void

  • Open a crypto store.

    The created store will be based on IndexedDB if a store_name is provided; otherwise it will be based on a memory store and once the objects is dropped, the keys will be lost.

    Arguments

    • store_name - The name that should be used to open the IndexedDB based database. If this isn't provided, a memory-only store will be used. Note the memory-only store will lose your E2EE keys when the StoreHandle gets dropped.

    • store_passphrase - The passphrase that should be used to encrypt the store, for IndexedDB-based stores

    Parameters

    • Optionalstore_name: string
    • Optionalstore_passphrase: string

    Returns Promise<StoreHandle>

  • Open a crypto store based on IndexedDB, using the given key for encryption.

    Arguments

    • store_name - The name that should be used to open the IndexedDB based database.

    • store_key - The key that should be used to encrypt the store, for IndexedDB-based stores. Must be a 32-byte array.

    Parameters

    • store_name: string
    • store_key: Uint8Array<ArrayBufferLike>

    Returns Promise<StoreHandle>