MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / verifyChainSignature

Function verifyChainSignature

src/cli/maintain-audit.ts:117–122  ·  view source on GitHub ↗
(head: string, signature: string, key: string)

Source from the content-addressed store, hash-verified

115
116/** Timing-safe verification of a head signature. PURE. */
117export function verifyChainSignature(head: string, signature: string, key: string): boolean {
118 const expected = signChainHead(head, key);
119 if (expected.length !== signature.length) return false;
120 try { return timingSafeEqual(Buffer.from(expected, 'hex'), Buffer.from(signature, 'hex')); }
121 catch { return false; }
122}
123
124/** Assemble the exportable log, signing the head when a key is provided. PURE (pass `exportedAt`). */
125export function buildSignedAuditLog(runs: AuditableRun[], opts: { exportedAt: string; key?: string }): SignedAuditLog {

Callers 3

verifyHistoryAuditFunction · 0.85
verifyAuditLogFunction · 0.85

Calls 1

signChainHeadFunction · 0.85

Tested by

no test coverage detected