@kya-os/mcp-i
Version:
COMING SOON:Production-ready MCP Identity with automatic registration, key rotation, and optimized performance
57 lines • 1.46 kB
TypeScript
/**
* Key rotation support for MCP-I
*/
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);
/**
* Check key health and rotation needs
*/
checkKeyHealth(): KeyHealth;
/**
* Increment signature count
*/
incrementSignatureCount(): void;
/**
* Rotate keys with the registry
*/
rotateKeys(reason?: string): Promise<KeyRotationResult>;
/**
* Setup automatic rotation based on policy
*/
setupAutoRotation(callback?: (result: KeyRotationResult) => void): NodeJS.Timer;
/**
* Get registry URL based on DID host
*/
private getRegistryUrl;
/**
* Extract agent ID from DID or identity
*/
private extractAgentId;
}
//# sourceMappingURL=rotation.d.ts.map