Pluto Encrypted is a secure storage wrapper for IndexDB and AtalaPrism (Pluto)
This package is compatible with Atala Prism Wallet SDK vile:atala-prism-wallet-sdk-3.1.0.tgz
Statements | Branches | Functions | Lines |
---|---|---|---|
We currently provide 2 database storages, one IndexDB and one InMemory storage. In order to use this package, you must first install the database and pass a storage engine.
npm i @pluto-encrypted/database --save
npm i @pluto-encrypted/inmemory --save
# or npm i @pluto-encrypted/indexdb --save
# or npm i @pluto-encrypted/leveldb --save
import InMemory from "@pluto-encrypted/inmemory";
import { Database } from "@pluto-encrypted/database";
//default password must be 32 bytes long
const defaultPassword = new Uint8Array(32).fill(1);
const database = db = await Database.createEncrypted(
{
name: `my-db`,
encryptionKey: defaultPassword,
storage: InMemory,
}
);
import IndexDB from "@pluto-encrypted/indexdb";
import { Database } from "@pluto-encrypted/database";
//default password must be 32 bytes long
const defaultPassword = new Uint8Array(32).fill(1);
const database = db = await Database.createEncrypted(
{
name: `my-db`,
encryptionKey: defaultPassword,
storage: IndexDB,
}
);
import { createLevelDBStorage } from "@pluto-encrypted/leveldb";
import { Database } from "@pluto-encrypted/database";
//default password must be 32 bytes long
const defaultPassword = new Uint8Array(32).fill(1);
const database = db = await Database.createEncrypted(
{
name: `my-db`,
encryptionKey: defaultPassword,
storage: createLevelDBStorage({
dbName: "demo", path: "./demo"
}),
}
);