Skip to main content
Glama

CipherHUB Cryptography Toolkit

cms_enveloped_parse

[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)可拆解 标注,但本族不做其解密。

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses that it never decrypts, the 16MB input ceiling, the two-layer parsing approach (custom ASN.1 TLV walker with BER tolerance + asn1crypto), and that recipient_info_supported is set False for non-KeyTrans recipients. These are real behavioral traits beyond anything structured.

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 labeled sections 【算法】【参数】【输出】【注意】 that make scanning easy. The output enumeration is lengthy but justified by the absence of an output schema; overall every block earns its place.

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?

There is no output schema, so the description must describe returns — and it enumerates them (content_type_oid, version, recipients, content_encryption_iv_hex, recipient_info_supported, ber_features, structure_tree with offset/length_form/rfc_note). Combined with the no-decryption and recipient-support caveats, an agent has everything needed to call it 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% for the single cms_in_hex parameter, and the description's parameter note (hex DER/BER, ≤16MB, BER indefinite-length accepted) largely restates what the schema already documents. Baseline 3 is appropriate since the schema does the heavy lifting.

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+resource: pure decomposition of CMS EnvelopedData (RFC 5652 §6) / authEnvelopedData (RFC 5083), and immediately excludes decryption (不解密). This clearly separates it from the sibling cms_enveloped_decrypt without opening either schema.

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 '不解密' boundary and the note that KARI/KEKRI/PWRI/ORI recipients can be parsed but not decrypted tell the agent when this tool applies and when to route to a decrypt tool. It stops short of naming the alternative explicitly, so it's clear context rather than a full when/when-not statement.

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.