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

Function testSelfSignedSigning

test/sign.e2e.test.ts:331–349  ·  view source on GitHub ↗

* Test signing with self-signed certificate

()

Source from the content-addressed store, hash-verified

329 * Test signing with self-signed certificate
330 */
331async function testSelfSignedSigning() {
332 // Create a copy for this test
333 const testFile = path.join(TEST_DIR, "test-self-signed.dxt");
334 fs.copyFileSync(TEST_MCPB, testFile);
335
336 // Sign the file
337 expect(() =>
338 signMcpbFile(testFile, SELF_SIGNED_CERT, SELF_SIGNED_KEY),
339 ).not.toThrow();
340
341 // Verify the signature
342 const result = await verifyMcpbFile(testFile);
343
344 // Self-signed certs may not be trusted by OS, so we accept either status
345 expect(["self-signed", "unsigned"]).toContain(result.status);
346
347 // Clean up
348 fs.unlinkSync(testFile);
349}
350
351/**
352 * Test signing with CA-signed certificate

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…