@averox/cryptosphare
Version:
Real-time SDK for end-to-end encrypted messaging, key monitoring, and secure A/V streaming
38 lines (37 loc) • 1.1 kB
TypeScript
import { EventEmitter } from 'events';
export interface KeyMetadata {
createdAt: Date;
lastRotated: Date;
compromised: boolean;
usageCount: number;
}
export declare class KeyManager extends EventEmitter {
private keys;
private metadata;
private readonly logger;
private forwardSecrecyEnabled;
private quantumResistantEnabled;
constructor();
enableForwardSecrecy(): void;
enableQuantumResistance(): void;
generateKey(type: string): string;
getKey(type: string): string | undefined;
getKeyMetadata(type: string): KeyMetadata | undefined;
rotateKey(type: string): void;
private scheduleKeyRotation;
markKeyAsCompromised(type: string): void;
onKeyGenerated(callback: (data: {
type: string;
timestamp: Date;
}) => void): void;
onKeyRotated(callback: (data: {
type: string;
oldKey: string | undefined;
newKey: string;
timestamp: Date;
}) => void): void;
onKeyCompromised(callback: (data: {
type: string;
timestamp: Date;
}) => void): void;
}