@kya-os/mcp-i
Version:
The TypeScript MCP framework with identity features built-in
62 lines (61 loc) • 1.64 kB
TypeScript
/**
* Encryption utilities for ktaEncrypted storage mode
*/
export interface EncryptionResult {
ciphertext: string;
nonce: string;
publicKey: string;
}
export interface DecryptionParams {
ciphertext: string;
nonce: string;
publicKey: string;
privateKey: string;
}
/**
* Audience-key encryption for ktaEncrypted mode
* Uses X25519 key exchange + ChaCha20-Poly1305 AEAD
*/
export declare class AudienceKeyEncryption {
/**
* Generate a new key pair for encryption
*/
static generateKeyPair(): Promise<CryptoKeyPair>;
/**
* Encrypt data for a specific audience public key
*/
static encrypt(data: string, audiencePublicKey: string): Promise<EncryptionResult>;
/**
* Decrypt data using private key
*/
static decrypt(params: DecryptionParams): Promise<string>;
/**
* Import public key from base64 string
*/
private static importPublicKey;
/**
* Import private key from base64 string
*/
private static importPrivateKey;
/**
* Export public key to base64 string
*/
private static exportPublicKey;
/**
* Export private key to base64 string
*/
static exportPrivateKey(privateKey: CryptoKey): Promise<string>;
}
/**
* Simple symmetric encryption for testing
*/
export declare class SimpleEncryption {
/**
* Encrypt data with a password (for testing only)
*/
static encrypt(data: string, password: string): Promise<string>;
/**
* Decrypt data with a password (for testing only)
*/
static decrypt(encryptedData: string, password: string): Promise<string>;
}