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

Function createSelfSignedCertificate

src/cli/cli.ts:27–39  ·  view source on GitHub ↗

* Create a self-signed certificate for signing MCPB extensions

(certPath: string, keyPath: string)

Source from the content-addressed store, hash-verified

25 * Create a self-signed certificate for signing MCPB extensions
26 */
27function createSelfSignedCertificate(certPath: string, keyPath: string): void {
28 const subject = "/CN=MCPB Self-Signed Certificate/O=MCPB Extensions/C=US";
29
30 try {
31 // Generate a self-signed certificate valid for 10 years, no password
32 execSync(
33 `openssl req -x509 -newkey rsa:4096 -keyout "${keyPath}" -out "${certPath}" -days 3650 -nodes -subj "${subject}"`,
34 { stdio: "pipe" },
35 );
36 } catch (error) {
37 throw new Error(`Failed to create self-signed certificate: ${error}`);
38 }
39}
40
41// Create the CLI program
42const program = new Command();

Callers 1

cli.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…