UNPKG

@kya-os/mcp-bri

Version:

Give your MCP server cryptographic identity in 2 lines of code

32 lines 1 kB
/** * Cryptographic utilities for MCP-I * Implements Ed25519 signing and verification for challenge-response authentication */ /** * Generate a new Ed25519 key pair */ export declare function generateKeyPair(): Promise<{ publicKey: string; privateKey: string; }>; /** * Sign a message with Ed25519 */ export declare function sign(message: string | Buffer, privateKeyBase64: string): Promise<string>; /** * Verify an Ed25519 signature */ export declare function verify(message: string | Buffer, signatureBase64: string, publicKeyBase64: string): Promise<boolean>; /** * Generate a cryptographically secure nonce */ export declare function generateNonce(length?: number): string; /** * Constant-time string comparison to prevent timing attacks */ export declare function constantTimeEqual(a: string, b: string): boolean; /** * Convert Ed25519 public key to did:key format */ export declare function publicKeyToDid(publicKeyBase64: string): string; //# sourceMappingURL=crypto.d.ts.map