/** * The magic bytes that mark the start of a ZIP file inside an SU3 container. */ declare const ZIP_MAGIC: Buffer; interface Su3Header { sigType: number; sigLength: number; versionLength: number; signerIdLength: number; contentLength: number; fileType: number; contentType: number; version: string; signerId: string; } /** * Parse the SU3 header from a raw buffer. * Returns null if the buffer doesn't start with the I2Psu3 magic. */ declare function parseSu3Header(buf: Buffer): Su3Header | null; /** * Maps a signer ID like "sahil@mail.i2p" to cert filename "sahil_at_mail.i2p.crt" */ declare function signerIdToCertFile(signerId: string): string; /** * Verify the cryptographic signature of an SU3 file against a PEM certificate. * Returns true if valid, false otherwise. */ declare function verifySu3Signature(su3Buffer: Buffer, certPem: string): boolean; /** * Strips the SU3 header from a raw buffer and returns just the ZIP payload. * Returns `null` if no ZIP header is found. */ declare function extractZipFromSu3(su3Buffer: Buffer): Buffer | null; interface ExtractResult { /** Total number of `.dat` entries written */ count: number; /** Base-names of the files that were written */ files: string[]; } /** * Extract all `routerInfo-*.dat` entries from every `.su3` file found in * `seedsDir` into `targetDir`. When `crtDir` and `servers` are provided, * verifies each SU3 against the cert mapped in reseed.json. * Returns the count and list of files written. */ declare function extractNetDb(seedsDir: string, targetDir: string, crtDir?: string, servers?: ReseedServer[]): Promise; interface ReseedServer { url: string; crt_file: string; } /** * Download fresh `.su3` files from reseed servers into `outputDir`. * Uses the built-in reseed.json list or a user-supplied one. */ declare function refreshSeeds(servers: ReseedServer[], outputDir: string, timeoutMs?: number): Promise; export { verifySu3Signature, signerIdToCertFile, refreshSeeds, parseSu3Header, extractZipFromSu3, extractNetDb, ZIP_MAGIC, Su3Header, ReseedServer, ExtractResult };