@wireapp/cryptobox
Version:
High-level API with persistent storage for Proteus.
18 lines (17 loc) • 1.13 kB
TypeScript
import * as ProteusKeys from '@wireapp/proteus/dist/keys/root';
import * as ProteusSession from '@wireapp/proteus/dist/session/root';
interface CryptoboxStore {
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: Array<ProteusKeys.PreKey>): Promise<Array<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 CryptoboxStore;