/**
 * Key Manager - ECDSA secp256k1 Key Generation and Storage
 *
 * Handles secure generation, storage, and retrieval of cryptographic keys.
 * Private keys are stored securely using expo-secure-store and never leave the device.
 */
import type { ECKeyPair } from 'elliptic';
export interface KeyPair {
    publicKey: string;
    privateKey: string;
}
export declare class KeyManager {
    private static cachedPublicKey;
    private static cachedHasIdentity;
    /**
     * Invalidate cached identity state
     * Called internally when identity is created/deleted/imported
     */
    private static invalidateCache;
    /**
     * Generate a new ECDSA secp256k1 key pair
     * Returns the keys in hexadecimal format
     */
    static generateKeyPairSync(): KeyPair;
    /**
     * Generate a new key pair using secure random bytes
     */
    static generateKeyPair(): Promise<KeyPair>;
    /**
     * Generate and securely store a new key pair on the device
     * Returns only the public key (private key is stored securely)
     */
    static createIdentity(): Promise<string>;
    /**
     * Import an existing key pair (e.g., from recovery phrase)
     */
    static importKeyPair(privateKey: string): Promise<string>;
    /**
     * Get the stored private key
     * WARNING: Only use this for signing operations within the app
     */
    static getPrivateKey(): Promise<string | null>;
    /**
     * Get the stored public key (cached for performance)
     */
    static getPublicKey(): Promise<string | null>;
    /**
     * Check if an identity (key pair) exists on this device (cached for performance)
     */
    static hasIdentity(): Promise<boolean>;
    /**
     * Delete the stored identity (both keys)
     * Use with EXTREME caution - this is irreversible without a recovery phrase
     * This should ONLY be called when explicitly requested by the user
     * @param skipBackup - If true, skip backup before deletion (default: false)
     * @param force - If true, skip confirmation checks (default: false)
     * @param userConfirmed - If true, user has explicitly confirmed deletion (default: false)
     */
    static deleteIdentity(skipBackup?: boolean, force?: boolean, userConfirmed?: boolean): Promise<void>;
    /**
     * Backup identity to SecureStore (separate backup storage)
     * This provides a recovery mechanism if primary storage fails
     */
    static backupIdentity(): Promise<boolean>;
    /**
     * Verify identity integrity - checks if keys are valid and accessible
     */
    static verifyIdentityIntegrity(): Promise<boolean>;
    /**
     * Restore identity from backup if primary storage is corrupted
     */
    static restoreIdentityFromBackup(): Promise<boolean>;
    /**
     * Get the elliptic curve key object from the stored private key
     * Used internally for signing operations
     */
    static getKeyPairObject(): Promise<ECKeyPair | null>;
    /**
     * Derive public key from a private key (without storing)
     */
    static derivePublicKey(privateKey: string): string;
    /**
     * Validate that a string is a valid public key
     */
    static isValidPublicKey(publicKey: string): boolean;
    /**
     * Validate that a string is a valid private key
     */
    static isValidPrivateKey(privateKey: string): boolean;
    /**
     * Get a shortened version of the public key for display
     * Format: first 8 chars...last 8 chars
     */
    static shortenPublicKey(publicKey: string): string;
}
export default KeyManager;
//# sourceMappingURL=keyManager.d.ts.map