@commit451/salamander
Version: 
Never be AFK
56 lines • 1.99 kB
TypeScript
import { type DeviceKey } from '../types/runner.js';
export declare class MultiDeviceKeyManagerService {
    private static readonly KEYS_STORAGE_KEY;
    private static readonly KEY_EXPIRY_DAYS;
    /**
     * Initialize keys for a new runner (CLI side)
     */
    static initializeRunnerKeys(runnerId: string): Promise<{
        publicKey: string;
        privateKey: string;
    }>;
    /**
     * Register a new device and derive shared secret
     */
    static registerDevice(runnerId: string, deviceKey: DeviceKey): Promise<string>;
    /**
     * Remove a device from the runner
     */
    static removeDevice(runnerId: string, deviceId: string): Promise<void>;
    /**
     * Get shared secret for specific device
     */
    static getSharedSecret(runnerId: string, deviceId: string): Promise<string | null>;
    /**
     * Get all registered device IDs for a runner
     */
    static getRegisteredDevices(runnerId: string): Promise<string[]>;
    /**
     * Encrypt command for specific device
     */
    static encryptForDevice(runnerId: string, deviceId: string, command: string): Promise<string>;
    /**
     * Encrypt command for all registered devices
     */
    static encryptForAllDevices(runnerId: string, command: string): Promise<Record<string, string>>;
    /**
     * Decrypt command from specific device
     */
    static decryptFromDevice(runnerId: string, deviceId: string, encryptedCommand: string): Promise<string>;
    /**
     * Check if runner has any registered devices
     */
    static hasRegisteredDevices(runnerId: string): Promise<boolean>;
    /**
     * Clean up all keys for a runner
     */
    static removeRunnerKeys(runnerId: string): Promise<void>;
    /**
     * Get CLI's public key for a runner
     */
    static getCliPublicKey(runnerId: string): Promise<string | null>;
    private static getRunnerKeys;
    private static storeRunnerKeys;
    private static getAllStoredKeys;
}
//# sourceMappingURL=multi-device-key-manager.d.ts.map