@kya-os/mcp-i
Version:
COMING SOON:Production-ready MCP Identity with automatic registration, key rotation, and optimized performance
36 lines (35 loc) • 1.04 kB
TypeScript
import { PersistedIdentity } from './types';
import { Transport } from './transport';
export interface KeyRotationPolicy {
maxAge?: number;
maxSignatures?: number;
algorithm?: string;
}
export interface KeyRotationResult {
success: boolean;
newKeyId?: string;
oldKeyId?: string;
gracePeriodEnd?: Date;
error?: string;
}
export interface KeyHealth {
age: number;
signatureCount: number;
shouldRotate: boolean;
lastRotated?: Date;
}
export declare class KeyRotationManager {
private identity;
private transport;
private policy;
private signatureCount;
private keyCreatedAt;
private lastRotatedAt?;
constructor(identity: PersistedIdentity, transport: Transport, policy?: KeyRotationPolicy);
checkKeyHealth(): KeyHealth;
incrementSignatureCount(): void;
rotateKeys(reason?: string): Promise<KeyRotationResult>;
setupAutoRotation(callback?: (result: KeyRotationResult) => void): NodeJS.Timer;
private getRegistryUrl;
private extractAgentId;
}