* Test signing with self-signed certificate
()
| 329 | * Test signing with self-signed certificate |
| 330 | */ |
| 331 | async 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 |
no test coverage detected
searching dependent graphs…