Skip to main content
Glama

CipherHUB Cryptography Toolkit

cose_sign1_verify

[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 数组才返回错误码。

Input Schema

TableJSON 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
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does it well: it discloses algorithm dispatch limits (-7/-35/-36 and -8), the success-response quirk that verified=false is a successful response with a reason, and the key-source fallback behavior. It could additionally clarify behavior for unsupported algorithms or missing certificate fields, but the disclosed traits are genuinely informative.

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

Conciseness4/5

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

The description is organized into labeled sections (algorithm, parameters, output, notes) and front-loads the tool's purpose before diving into details. Some parameter text repeats the schema, but every section contributes meaningful information and the structure aids scanning.

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?

Given no output schema, the description compensates by listing the return fields and explaining the unusual verified=false success semantics. It covers key behavior, key-source resolution, input size limits, and the output payload. Minor gaps remain around detached-payload handling and specific error cases, but overall the agent has enough context to call the tool correctly.

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

Parameters3/5

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

Schema coverage is 100%, so each parameter is already documented in the input schema. The description adds some useful nuance, such as the external AAD needing to match the signing-time value and the public-key fallback to the certificate, but these largely duplicate or only lightly extend the schema descriptions. It also omits detached_payload_in_hex from its parameter list, though the schema covers it.

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

Purpose5/5

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

The description opens with a specific verb-resource pair: '验证 COSE_Sign1 签名' (verify COSE_Sign1 signature) and anchors it to RFC 9052 §4.4 Sig_structure reconstruction. It also enumerates supported algorithms, which clearly distinguishes this tool from cose_sign1_parse and cose_sign1_sign.

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

Usage Guidelines4/5

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

The description gives clear operational context: when to provide a PEM key versus leaving it empty to extract from the payload certificate, and that external_aad_in_hex must match the value used at signing time. It does not explicitly state when to prefer this over siblings, but the verification purpose and parameter conditions make the intended usage clear.

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.