Skip to main content
Glama

CipherHUB Cryptography Toolkit

cms_enveloped_parse

Read-only

[cms_enveloped] 纯拆解 CMS EnvelopedData(RFC 5652 §6)/ authEnvelopedData(RFC 5083), 不解密。 【算法】自写 ASN.1 TLV walker(X.690 BER 容忍)出结构树 + asn1crypto 出结构化字段,两层对照。 【参数】

  • cms_in_hex:信封 DER/BER 的十六进制(≤16MB) 【输出】content_type_oid(envelopedData = 1.2.840.113549.1.7.3 / authEnvelopedData = 1.2.840.113549.1.9.16.1.23)、 version、recipients(rid 类型 / wrap 算法+OID / encryptedKey 字节数)、 content_encryption_iv_hex(IV 本就是公开字段)、 recipient_info_supported(非 KeyTrans 收件人置 False)、 ber_features、structure_tree(含 offset/length_form/rfc_note)。 【注意】KARI/KEKRI/PWRI/ORI 收件人(RFC 5652 §6.2.2-6.2.6)可拆解 标注,但本族不做其解密。

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": "cms_enveloped_parse"
  }
}

Input Schema

NameRequiredDescriptionDefault
cms_in_hexNoCMS 信封 DER/BER 编码的十六进制字符串(≤16MB;KMS 回包这类 BER 不定长编码可直接输入)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Goes well beyond the readOnly/openWorld annotations: discloses a custom X.690 BER-tolerant TLV walker cross-checked against asn1crypto, a ≤16MB input ceiling, and that recipient_info_supported is False for non-KeyTrans recipients. It also pre-empts a privacy concern by noting the IV is inherently public. It does not say what happens on malformed input or how the two-layer comparison is reported on mismatch.

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?

Front-loaded with a bracketed tag and the parse-only constraint, then cleanly sectioned into 【算法】【参数】【输出】【注意】. It is long, but the length is justified because no output schema exists and the 【输出】 block substitutes for one; the algorithm paragraph is the least essential part.

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

Completeness5/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 fully enumerates the return fields (content_type_oid values, version, recipients, IV hex, recipient_info_supported, ber_features, structure_tree) and documents the recipient types it can label but not decrypt. An agent has everything needed to call it and interpret the result.

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?

Only one parameter and schema coverage is 100%, including the ≤16MB limit and the BER indefinite-length acceptance, so the schema already carries the semantics. The 【参数】 section restates the hex input without adding format or encoding guidance beyond it, making 3 the correct baseline.

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?

States a precise verb and resource — 纯拆解 (pure parsing of) CMS EnvelopedData (RFC 5652 §6) / authEnvelopedData (RFC 5083) — and immediately rules out decryption (不解密), which separates it from the sibling cms_enveloped_decrypt. The spec citations pin down exactly which structures are handled.

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 '不解密' clause and the note that KARI/KEKRI/PWRI/ORI recipients can be parsed but not decrypted give clear context for when this tool applies. It stops short of naming cms_enveloped_decrypt as the alternative, so an agent must infer the routing rather than being told it.

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.