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

Function createSignatureBlock

src/node/sign.ts:224–240  ·  view source on GitHub ↗

* Creates a signature block buffer with PKCS#7 signature

(pkcs7Signature: Buffer)

Source from the content-addressed store, hash-verified

222 * Creates a signature block buffer with PKCS#7 signature
223 */
224function createSignatureBlock(pkcs7Signature: Buffer): Buffer {
225 const parts: Buffer[] = [];
226
227 // Header
228 parts.push(Buffer.from(SIGNATURE_HEADER, "utf-8"));
229
230 // PKCS#7 signature length and data
231 const sigLengthBuffer = Buffer.alloc(4);
232 sigLengthBuffer.writeUInt32LE(pkcs7Signature.length, 0);
233 parts.push(sigLengthBuffer);
234 parts.push(pkcs7Signature);
235
236 // Footer
237 parts.push(Buffer.from(SIGNATURE_FOOTER, "utf-8"));
238
239 return Buffer.concat(parts);
240}
241
242/**
243 * Extracts the signature block from a signed MCPB file

Callers 1

signMcpbFileFunction · 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…