import type { ICipherModule, IPbkdf2KdfModule } from "@chainsafe/bls-keystore"; import type { KeystoreEntity, MembershipHash, Password, Sha256Hash } from "./types.js"; type NwakuCredential = { crypto: { cipher: ICipherModule["function"]; cipherparams: ICipherModule["params"]; ciphertext: ICipherModule["message"]; kdf: IPbkdf2KdfModule["function"]; kdfparams: IPbkdf2KdfModule["params"]; mac: Sha256Hash; }; }; interface NwakuKeystore { application: string; version: string; appIdentifier: string; credentials: { [key: MembershipHash]: NwakuCredential; }; } type KeystoreCreateOptions = { application?: string; version?: string; appIdentifier?: string; }; export declare class Keystore { private data; private constructor(); static create(options?: KeystoreCreateOptions): Keystore; static fromString(str: string): undefined | Keystore; static fromObject(obj: NwakuKeystore): Keystore; addCredential(options: KeystoreEntity, password: Password): Promise; readCredential(membershipHash: MembershipHash, password: Password): Promise; removeCredential(hash: MembershipHash): void; toString(): string; toObject(): NwakuKeystore; /** * Read array of hashes of current credentials * @returns array of keys of credentials in current Keystore */ keys(): string[]; private static isValidNwakuStore; private static fromCredentialToEip; private static fromEipToCredential; private static fromBytesToIdentity; private static fromArraylikeToBytes; private static computeMembershipHash; private static fromIdentityToBytes; } export {};