trojanhorse-js
Version:
A comprehensive JavaScript library for fetching, managing, and analyzing global threat intelligence from multiple open-source feeds and security news sources. Unlike its mythological namesake, this Trojan protects your digital fortress.
66 lines • 2.24 kB
TypeScript
/// <reference types="node" />
import { RealEncryptionResult } from './CryptoEngine';
import { ApiKeyConfig, SecureVaultOptions } from '../types';
export declare class KeyVault {
private cryptoEngine;
private encryptedVault;
private decryptedKeys;
private isLocked;
private options;
private autoLockTimer;
private lastAccessTime;
private failedAttempts;
private maxFailedAttempts;
private lockoutDuration;
constructor(options?: SecureVaultOptions);
private extractApiKey;
private normalizeApiKeys;
createVault(password: string, apiKeys: ApiKeyConfig): Promise<RealEncryptionResult>;
loadVault(vault: RealEncryptionResult): void;
unlock(password: string): Promise<void>;
lock(): void;
getApiKey(provider: string): string;
setApiKey(provider: string, apiKey: string, password: string): Promise<void>;
removeApiKey(provider: string, password: string): Promise<void>;
rotateKey(provider: string, newKey: string, options?: {
gracePeriod?: number;
password?: string;
notifyRotation?: boolean;
}): Promise<void>;
rotateMultipleKeys(keyUpdates: Record<string, string>, options?: {
password?: string;
gracePeriod?: number;
continueOnError?: boolean;
}): Promise<{
success: string[];
failed: Record<string, string>;
}>;
setupKeyRotation(config: {
providers: string[];
rotationInterval: number;
keyGenerator: (provider: string) => Promise<string>;
password: string;
}): NodeJS.Timeout;
getStatus(): {
isLocked: boolean;
hasVault: boolean;
keyCount: number;
lastAccess: Date | null;
autoLockEnabled: boolean;
failedAttempts: number;
};
getProviders(): string[];
testApiKey(provider: string): Promise<boolean>;
exportVault(): RealEncryptionResult;
private lockVault;
private updateAccessTime;
private setupAutoLock;
private clearAutoLockTimer;
private validatePassword;
private calculatePasswordEntropy;
private hasWeakPatterns;
private validateApiKeys;
private sanitizeProvider;
private auditLog;
}
//# sourceMappingURL=KeyVault.d.ts.map