MCPcopy Create free account
hub / github.com/modelcontextprotocol/mcpb / testCASignedSigning

Function testCASignedSigning

test/sign.e2e.test.ts:354–372  ·  view source on GitHub ↗

* Test signing with CA-signed certificate

()

Source from the content-addressed store, hash-verified

352 * Test signing with CA-signed certificate
353 */
354async function testCASignedSigning() {
355 // Create a copy for this test
356 const testFile = path.join(TEST_DIR, "test-ca-signed.dxt");
357 fs.copyFileSync(TEST_MCPB, testFile);
358
359 // Sign the file with intermediate
360 expect(() =>
361 signMcpbFile(testFile, SIGNED_CERT, SIGNED_KEY, [CA_CERT]),
362 ).not.toThrow();
363
364 // Verify the signature
365 const result = await verifyMcpbFile(testFile);
366
367 // CA-signed status depends on whether test CA is trusted by OS
368 expect(["signed", "unsigned"]).toContain(result.status);
369
370 // Clean up
371 fs.unlinkSync(testFile);
372}
373
374/**
375 * Test tampering detection

Callers 1

sign.e2e.test.tsFile · 0.85

Calls 2

signMcpbFileFunction · 0.85
verifyMcpbFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…