Skip to main content
Glama

CipherHUB Cryptography Toolkit

cose_sign1_verify

Read-only

[cose_sign1] 验证 COSE_Sign1 签名(RFC 9052 §4.4 Sig_structure 重构验签)。 【算法】按 protected 头 alg 声明分派:-7/-35/-36(ES,裸 r||s → DER) 与 -8(Ed25519)。 【参数】

  • cose_sign1_in_hex:COSE_Sign1 消息(≤128KB,hex)

  • ecc_public_key_in_pem:验签公钥 PEM。留空时从 payload 的 certificate 字段提取公钥(复刻 KMS 验 Nitro attestation 文档方式)

  • external_aad_in_hex:与签名时一致的外部 AAD(可选) 【输出】verified(bool)、reason、key_source(provided_pem 或 payload_certificate)、protected_header、payload_in_hex、payload_json、 payload_certificate_in_pem、sig_structure_in_hex、structure_tree。 【注意】verified=false 是成功响应(附 reason);仅消息无法解析为 4 元素 COSE_Sign1 数组才返回错误码。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "cose_sign1_verify"
  }
}

Input Schema

NameRequiredDescriptionDefault
cose_sign1_in_hexNoCOSE_Sign1 消息的十六进制字符串(≤128KB,4 元素数组)
external_aad_in_hexNo外部 AAD 的十六进制字符串(可选;参与 Sig_structure 但不出现在消息里)
ecc_public_key_in_pemNoECC 公钥的 PEM 文本(含 BEGIN/END 头尾的 Base64 编码文本)
detached_payload_in_hexNodetached 消息的外部载荷十六进制字符串(消息 payload 为 null 时验签必填,1B~256KB)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / detached_payload_in_hex / description
      Added value: +"detached 消息的外部载荷十六进制字符串(消息 payload 为 null 时验签必填,1B~256KB)"
  2. Added

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well past readOnlyHint/openWorldHint by disclosing that verified=false with a reason is a SUCCESS response and that only an unparseable (non-4-element) message yields an error code — a critical contract for interpreting results. It also documents key_source echoing, the full return field set, and the r||s→DER conversion behavior per algorithm.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Uses labeled sections (algorithm, parameters, output, notes) with the outcome-contract note front-loadable and the verified=false semantics called out. Every line carries information that is not in the annotations, and the output field enumeration is warranted because no output schema exists.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description compensates by enumerating return fields (verified, reason, key_source, payload_json, sig_structure_in_hex, structure_tree). The one gap is detached-payload verification, a meaningful mode that appears only in the input schema and not in the description's parameter list.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3; the description adds real meaning by stating that external AAD must match the value used at signing time and that the PEM parameter is optional with a certificate-extraction fallback. It omits detached_payload_in_hex entirely, which the schema documents but which the description's parameter list silently skips.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource tightly scoped: verify a COSE_Sign1 signature by reconstructing Sig_structure per RFC 9052 §4.4, with an explicit list of supported algorithms (-7/-35/-36 EC, -8 Ed25519). The purpose is unambiguous, though no sibling is named (e.g. cose_sign1_parse for decoding without verification), so differentiation is left to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives conditional guidance for the key source (leave ecc_public_key_in_pem empty to extract from the payload's certificate field, mirroring how KMS verifies Nitro attestation documents) and requires external AAD to match signing time. However, it never states when to choose this tool over cose_sign1_parse or cose_sign1_sign, nor prerequisites beyond them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.