@wireapp/cryptobox
Version:
High-level API with persistent storage for Proteus.
32 lines (31 loc) • 1.6 kB
TypeScript
import * as ProteusKeys from '@wireapp/proteus/dist/keys/root';
import * as ProteusSession from '@wireapp/proteus/dist/session/root';
import { CRUDEngine } from '@wireapp/store-engine/dist/commonjs/engine/index';
import { CryptoboxStore } from '../store/root';
declare class CryptoboxCRUDStore implements CryptoboxStore {
private engine;
constructor(engine: CRUDEngine);
static readonly KEYS: {
LOCAL_IDENTITY: string;
};
static readonly STORES: {
LOCAL_IDENTITY: string;
PRE_KEYS: string;
SESSIONS: string;
};
private from_store(record);
private to_store(serialised);
delete_all(): Promise<boolean>;
delete_prekey(prekey_id: number): Promise<number>;
load_identity(): Promise<ProteusKeys.IdentityKeyPair | undefined>;
load_prekey(prekey_id: number): Promise<ProteusKeys.PreKey | undefined>;
load_prekeys(): Promise<Array<ProteusKeys.PreKey>>;
save_identity(identity: ProteusKeys.IdentityKeyPair): Promise<ProteusKeys.IdentityKeyPair>;
save_prekey(pre_key: ProteusKeys.PreKey): Promise<ProteusKeys.PreKey>;
save_prekeys(pre_keys: ProteusKeys.PreKey[]): Promise<ProteusKeys.PreKey[]>;
create_session(session_id: string, session: ProteusSession.Session): Promise<ProteusSession.Session>;
read_session(identity: ProteusKeys.IdentityKeyPair, session_id: string): Promise<ProteusSession.Session>;
update_session(session_id: string, session: ProteusSession.Session): Promise<ProteusSession.Session>;
delete_session(session_id: string): Promise<string>;
}
export default CryptoboxCRUDStore;