import { type GuideEntryV1, type GuideManifestV1 } from "./manifest"; /** * Version of the SDK advisory guide client. Manifests carry a * `minimumSdkVersion` compatibility floor; a manifest that requires a newer * client is refused (`incompatible`) instead of being partially understood. */ export declare const GUIDE_CLIENT_VERSION = 1; /** Ed25519 detached signatures are always exactly 64 bytes. */ export declare const GUIDE_SIGNATURE_BYTES = 64; export interface GuidePinnedKey { keyId: string; /** DER-encoded SPKI public key, hex. */ spkiDerHex: string; source: "bundled"; } export declare const GUIDE_PINNED_KEYS: readonly GuidePinnedKey[]; export declare const GUIDE_PINNED_KEY_IDS: readonly string[]; export type GuideVerificationErrorCode = "invalid_manifest" | "unsupported_version" | "unknown_key" | "corrupt_signature" | "invalid_signature" | "not_yet_valid" | "expired" | "incompatible" | "rollback" | "hash_mismatch" | (string & {}); export type GuideVerificationResult = { ok: true; value: T; } | { ok: false; error: { code: GuideVerificationErrorCode; message: string; }; }; /** Test-only override: installs an additional trusted key for deterministic tests. */ export declare function addTestGuidePinnedKey(key: GuidePinnedKey): void; /** Test-only override: removes a previously installed test key. */ export declare function removeTestGuidePinnedKey(keyId: string): void; /** * Verifies a guide manifest end to end and fails closed on the first broken * property. Order matters: identity and tamper checks (unknown key, malformed * or mismatched signature) run before temporal and compatibility checks, so a * tampered or untrusted manifest is never masked by an expiry message. */ export declare function verifyGuideManifest(params: { manifest: GuideManifestV1; signatureBytes: Uint8Array; now: number; }): GuideVerificationResult<{ keyId: string; }>; /** * Monotonic floor check: a candidate manifest for a channel must strictly * advance that channel's sequence, otherwise an older (but still validly * signed) manifest is refused as a rollback. */ export declare function guideRollbackCheck(previous: { manifestId: string; sequence: number; } | undefined, candidate: GuideManifestV1): GuideVerificationResult<{ monotonic: boolean; }>; export declare function guideAdvisoryDigest(text: Uint8Array): string; /** * Per-guide SHA-256 binding: the advisory text must match the digest the * signed manifest binds for that guide id. This is the tamper check for the * advisory payload itself — the manifest signature cannot cover content that * is fetched separately, so every advisory is hash-verified against it. */ export declare function verifyGuideAdvisoryText(entry: GuideEntryV1, text: Uint8Array): GuideVerificationResult<{ sha256: string; }>;