import { IdentityKeyPair, PreKeyRecord, SignedPreKeyRecord, KyberPreKeyRecord, PreKeyBundle, ProtocolAddress, CiphertextMessage, DecryptedMessage } from './SignalExpo.types'; export { IdentityKeyPair, PreKeyRecord, SignedPreKeyRecord, KyberPreKeyRecord, PreKeyBundle, ProtocolAddress, CiphertextMessage, DecryptedMessage, }; /** * Generate a new identity key pair for the Signal Protocol. * This should be called once when setting up a new user/device. */ export declare function generateIdentityKeyPair(): IdentityKeyPair; /** * Generate a registration ID for the Signal Protocol. * This is a 14-bit value used to identify the local installation. */ export declare function generateRegistrationId(): number; /** * Generate a batch of pre-keys for the X3DH key agreement. * Pre-keys should be uploaded to your server for other users to fetch. * * @param start - Starting ID for the pre-keys * @param count - Number of pre-keys to generate */ export declare function generatePreKeys(start: number, count: number): PreKeyRecord[]; /** * Generate a signed pre-key for the X3DH key agreement. * The signed pre-key is signed with the identity key for verification. * * @param identityKeyPair - The identity key pair to sign with * @param signedPreKeyId - ID for the signed pre-key */ export declare function generateSignedPreKey(identityKeyPair: IdentityKeyPair, signedPreKeyId: number): SignedPreKeyRecord; /** * Generate Kyber (post-quantum) pre-keys for PQXDH key agreement. * These provide quantum-resistant key exchange when establishing sessions. * * @param start - Starting ID for the Kyber pre-keys * @param count - Number of Kyber pre-keys to generate * @param identityKeyPair - The identity key pair to sign with */ export declare function generateKyberPreKeys(start: number, count: number, identityKeyPair: IdentityKeyPair): KyberPreKeyRecord[]; /** * Clear all in-memory stores for user switching. * Call this before initialize() when switching users. */ export declare function clear(): Promise; /** * Initialize the Signal protocol with keys. * Must be called before using encrypt/decrypt. * * @param identityKeyPair - The identity key pair * @param registrationId - The registration ID * @param preKeys - Array of pre-keys * @param signedPreKey - The signed pre-key */ export declare function initialize(identityKeyPair: IdentityKeyPair, registrationId: number, preKeys: PreKeyRecord[], signedPreKey: SignedPreKeyRecord): Promise; /** * Store Kyber pre-keys in the native module. * Called during initializeFromStore to restore Kyber keys needed for decryption. * * @param kyberPreKeys - Array of Kyber pre-keys with serialized records */ export declare function storeKyberPreKeys(kyberPreKeys: KyberPreKeyRecord[]): Promise; /** * Initialize a session from a pre-key bundle fetched from the server. * This establishes the initial encrypted session with a recipient. * * @param address - The recipient's address * @param bundle - The recipient's pre-key bundle */ export declare function createSession(address: ProtocolAddress, bundle: PreKeyBundle): Promise; /** * Check if a session exists with the given address. * * @param address - The address to check */ export declare function hasSession(address: ProtocolAddress): Promise; /** * Delete a session with the given address. * * @param address - The address whose session to delete */ export declare function deleteSession(address: ProtocolAddress): Promise; /** * Export a session for persistence. * Returns the serialized session bytes, or null if no session exists. * * @param address - The address whose session to export */ export declare function exportSession(address: ProtocolAddress): Promise; /** * Import a session from serialized bytes. * Used to restore sessions after switching users. * * @param address - The address for the session * @param serializedSession - The serialized session bytes */ export declare function importSession(address: ProtocolAddress, serializedSession: Uint8Array): Promise; /** * List all session addresses currently in memory. * * @returns Array of protocol addresses */ export declare function listSessions(): Promise; /** * Encrypt a message for the given recipient. * * @param address - The recipient's address * @param plaintext - The message to encrypt */ export declare function encrypt(address: ProtocolAddress, plaintext: Uint8Array): Promise; /** * Decrypt a message from the given sender. * * @param address - The sender's address * @param ciphertext - The encrypted message */ export declare function decrypt(address: ProtocolAddress, ciphertext: CiphertextMessage): Promise; /** * Get the local identity public key. * This can be shared with others for verification. */ export declare function getIdentityPublicKey(): Promise; /** * Get the local registration ID. */ export declare function getLocalRegistrationId(): Promise; //# sourceMappingURL=index.d.ts.map