import { a as EncryptedKeystore, s as HybridKeyPair } from "./types-D1R4_m5r.mjs"; //#region src/keystore-crypto/emailEncryptionKey.d.ts /** * Generates hybrid keys and creates encrypted main and recovery keystores * The main keystore encryption key is derived from the user's mnemonic * The recovery keystore encryption key is derived from the recovery codes * * @param userEmail - The user's email * @param mnemonic - The user's mnemonic * @returns The encryption keys * * @returns The encryption and recovery keystores, recovery codes and hybrid keys */ declare function createEncryptionAndRecoveryKeystores(userEmail: string, mnemonic: string): Promise<{ encryptionKeystore: EncryptedKeystore; recoveryKeystore: EncryptedKeystore; recoveryCodes: string; keys: HybridKeyPair; }>; /** * Opens the encryption keystore and returns the email encryption keys * The decryption key is derived from the user mnemonic * * @param encryptedKeystore - The encrypted keystore containing encryption keys * @param mnemonic - The user's mnemonic * @returns The encryption keys */ declare function openEncryptionKeystore(encryptedKeystore: EncryptedKeystore, mnemonic: string): Promise; /** * Opens the recovery keystore and returns the email encryption keys * The decryption key is derived from the recovery codes (machine-generated mnemonic) * * @param recoveryCodes - The user's recovery codes * @param encryptedKeystore - The encrypted keystore containing encryption keys * @returns The encryption keys */ declare function openRecoveryKeystore(recoveryCodes: string, encryptedKeystore: EncryptedKeystore): Promise; /** * Re-encrypts the encryption keystore with a new mnemonic * The decryption key is derived from the user mnemonic * * @param encryptedKeystore - The encrypted keystore containing encryption keys * @param oldMnemonic - The user's old mnemonic * @param newMnemonic - The user's new mnemonic * @returns The keys and new re-encrypted keystore */ declare function changeMnemonicForEncryptionKeystore(encryptedKeystore: EncryptedKeystore, oldMnemonic: string, newMnemonic: string): Promise<{ keys: HybridKeyPair; newKeystore: EncryptedKeystore; }>; //#endregion //#region src/keystore-crypto/errors.d.ts declare class FailedToCreateKeyStores extends Error { constructor(errorMsg?: string); } declare class InvalidInputKeyStore extends Error { constructor(); } declare class FailedToOpenEncryptionKeyStore extends Error { constructor(errorMsg?: string); } declare class FailedToOpenRecoveryKeyStore extends Error { constructor(errorMsg?: string); } declare class FailedToChangeMnemonicForKeyStore extends Error { constructor(errorMsg?: string); } //#endregion export { FailedToChangeMnemonicForKeyStore, FailedToCreateKeyStores, FailedToOpenEncryptionKeyStore, FailedToOpenRecoveryKeyStore, InvalidInputKeyStore, changeMnemonicForEncryptionKeystore, createEncryptionAndRecoveryKeystores, openEncryptionKeystore, openRecoveryKeystore }; //# sourceMappingURL=keystore-crypto.d.mts.map