/**
 * Thales Luna Network HSM Provider Implementation
 * Integrates with Luna Network HSM using PKCS#11 interface
 */
import { BaseHSMProvider, HSMProviderConfig, HSMStatus, KeySpec, KeyHandle, EncryptionOptions } from './provider';
export interface ThalesLunaConfig extends HSMProviderConfig {
    /** Luna HSM hostname or IP */
    host: string;
    /** Network port (default 1792) */
    port?: number;
    /** Partition name */
    partition: string;
    /** Partition password/PIN */
    partitionPassword: string;
    /** Client certificate path for mTLS */
    clientCertPath?: string;
    /** Client key path */
    clientKeyPath?: string;
    /** CA certificate path */
    caCertPath?: string;
    /** PKCS#11 library path */
    pkcs11LibPath?: string;
    /** Enable HA (High Availability) mode */
    haEnabled?: boolean;
    /** HA group members */
    haGroupMembers?: HAGroupMember[];
    /** Connection timeout */
    connectionTimeout?: number;
    /** Idle timeout */
    idleTimeout?: number;
}
/**
 * HA group member configuration
 */
export interface HAGroupMember {
    host: string;
    port?: number;
    priority?: number;
    serialNumber?: string;
}
/**
 * Luna partition info
 */
export interface PartitionInfo {
    label: string;
    serialNumber: string;
    freeSpace: number;
    usedSpace: number;
    objectCount: number;
    firmwareVersion: string;
    model: string;
}
export declare class ThalesLunaProvider extends BaseHSMProvider {
    readonly name = "Thales Luna HSM";
    readonly isProduction = true;
    private lunaConfig;
    private sessionHandle;
    private slotId;
    private keyMap;
    private handleCounter;
    private haActive;
    private currentHAMember;
    constructor(config: ThalesLunaConfig);
    /**
     * Connect to Luna HSM
     */
    connect(): Promise<void>;
    /**
     * Initialize PKCS#11 library
     */
    private initializePKCS11;
    /**
     * Setup HA group
     */
    private setupHAGroup;
    /**
     * Find slot for partition
     */
    private findPartitionSlot;
    /**
     * Open PKCS#11 session
     */
    private openSession;
    /**
     * Login to partition
     */
    private login;
    /**
     * Disconnect from Luna HSM
     */
    disconnect(): Promise<void>;
    /**
     * Get HSM status
     */
    getStatus(): Promise<HSMStatus>;
    /**
     * Get partition information
     */
    getPartitionInfo(): Promise<PartitionInfo>;
    /**
     * Generate key in Luna HSM
     */
    generateKey(spec: KeySpec): Promise<KeyHandle>;
    /**
     * Generate AES key
     */
    private generateAESKey;
    /**
     * Generate RSA key pair
     */
    private generateRSAKeyPair;
    /**
     * Generate EC key pair
     */
    private generateECKeyPair;
    /**
     * Generate 3DES key
     */
    private generate3DESKey;
    /**
     * Generate HMAC key
     */
    private generateHMACKey;
    /**
     * Import key
     */
    importKey(keyMaterial: Buffer, spec: KeySpec): Promise<KeyHandle>;
    /**
     * Export public key
     */
    exportPublicKey(keyHandle: string): Promise<Buffer>;
    /**
     * Get key
     */
    getKey(keyHandle: string): Promise<KeyHandle | null>;
    /**
     * List keys
     */
    listKeys(filter?: Partial<KeySpec>): Promise<KeyHandle[]>;
    /**
     * Sign data
     */
    sign(keyHandle: string, data: Buffer, algorithm: string): Promise<Buffer>;
    /**
     * Verify signature
     */
    verify(keyHandle: string, data: Buffer, signature: Buffer, algorithm: string): Promise<boolean>;
    /**
     * Encrypt data
     */
    encrypt(keyHandle: string, data: Buffer, options?: EncryptionOptions): Promise<Buffer>;
    /**
     * Decrypt data
     */
    decrypt(keyHandle: string, ciphertext: Buffer, options?: EncryptionOptions): Promise<Buffer>;
    /**
     * Wrap key
     */
    wrapKey(wrappingKeyHandle: string, keyToWrap: string, algorithm?: string): Promise<Buffer>;
    /**
     * Unwrap key
     */
    unwrapKey(wrappingKeyHandle: string, wrappedKey: Buffer, spec: KeySpec, algorithm?: string): Promise<string>;
    /**
     * Destroy key
     */
    destroyKey(keyHandle: string): Promise<void>;
    /**
     * Perform HA failover
     */
    performFailover(): Promise<void>;
    /**
     * Get HA status
     */
    getHAStatus(): Promise<{
        enabled: boolean;
        active: boolean;
        currentMember: HAGroupMember | null;
        members: Array<{
            member: HAGroupMember;
            status: 'online' | 'offline';
        }>;
    }>;
    /**
     * Clone partition to another HSM
     */
    clonePartition(targetHost: string, targetPartition: string): Promise<void>;
    /**
     * Backup partition
     */
    backupPartition(): Promise<Buffer>;
    /**
     * Restore partition from backup
     */
    restorePartition(backupData: Buffer): Promise<void>;
    /**
     * Get audit logs from HSM
     */
    getHSMAuditLogs(): Promise<Buffer>;
    /**
     * Update partition policy
     */
    updatePartitionPolicy(policy: {
        minPinLength?: number;
        maxFailedLogins?: number;
        challengeEnabled?: boolean;
    }): Promise<void>;
}
//# sourceMappingURL=thales-luna.d.ts.map