/** * EncryptID Key Derivation Module * * Derives application-specific cryptographic keys from WebAuthn PRF output * or passphrase fallback. Layer 2 of the EncryptID architecture. */ import type { DerivedKeys, EncryptedData, SignedData } from '../types/index.js'; export type { DerivedKeys, EncryptedData, SignedData }; export declare class EncryptIDKeyManager { private masterKey; private derivedKeys; private fromPRF; initFromPRF(prfOutput: ArrayBuffer): Promise; initFromPassphrase(passphrase: string, salt: Uint8Array): Promise; static generateSalt(): Uint8Array; isInitialized(): boolean; getKeys(): Promise; private deriveEncryptionKey; private deriveSigningKeyPair; /** * Derive deterministic secp256k1 keys from the master key via HKDF. * This gives every EncryptID identity an Ethereum-compatible wallet address, * enabling them to act as Gnosis Safe owners for multi-sig approvals. */ private deriveEthereumKeys; private deriveDIDSeed; private generateDID; clear(): void; } export declare function encryptData(key: CryptoKey, data: ArrayBuffer | Uint8Array | string): Promise; export declare function decryptData(key: CryptoKey, encrypted: EncryptedData): Promise; export declare function decryptDataAsString(key: CryptoKey, encrypted: EncryptedData): Promise; export declare function signData(keyPair: CryptoKeyPair, data: ArrayBuffer | Uint8Array | string): Promise; export declare function verifySignature(signed: SignedData): Promise; export declare function wrapKeyForRecipient(keyToWrap: CryptoKey, recipientPublicKey: CryptoKey): Promise; export declare function unwrapSharedKey(wrappedKey: ArrayBuffer, privateKey: CryptoKey): Promise; /** * Sign an Ethereum-compatible message hash with a secp256k1 private key. * Returns { r, s, v } components for Safe transaction signing. * * @param hash - 32-byte message hash (e.g. keccak256 of the message) * @param privateKey - 32-byte secp256k1 private key */ export declare function signEthHash(hash: Uint8Array, privateKey: Uint8Array): { r: string; s: string; v: number; signature: Uint8Array; }; export declare function getKeyManager(): EncryptIDKeyManager; export declare function resetKeyManager(): void;