Skip to main content
Glama

CipherHUB Cryptography Toolkit

cms_enveloped_decrypt

[cms_enveloped] 解密 CMS EnvelopedData(RFC 5652 §6)/ authEnvelopedData(RFC 5083), BER/DER 输入均容忍。 【算法】按消息声明还原算法:rsaesOaep 参数(hashFunc/MGF1/pSource, RFC 3560)重建 OAEP padding,内容算法按 OID 分派(CBC 去 PKCS#7 填充 / GCM 取独立 mac 字段验 AEAD,长度必须等于声明的 aes-ICVlen, authAttrs 存在时以 universal SET OF DER 作 AAD——RFC 5083 §3; EnvelopedData 下的 GCM 无定义,直接 reason 拒绝)。 【参数】

  • cms_in_hex:信封 DER/BER 的十六进制(≤16MB)

  • recipient_private_key_in_pem:收件人 RSA 私钥 PEM(可选;不给则 仅做结构拆解)

  • recipient_private_key_password:私钥口令(未加密则留空) 【输出】decrypted(bool)、reason、plain_data_in_hex、version、 wrap/CEA(从消息声明还原)、recipients、ber_features(不定长容器/ 分段八位串/非最短长度等 BER 特征清单)、structure_tree。 【注意】结构性解析成功即 success——解密失败落 decrypted=false + reason,树照常返回;AWS KMS 回包这类 BER 信封可直接喂入。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cms_in_hexNoCMS 信封 DER/BER 编码的十六进制字符串(≤16MB;KMS 回包这类 BER 不定长编码可直接输入)
recipient_private_key_in_pemNo收件人 RSA 私钥的 PEM 文本(含 BEGIN/END 头尾)
recipient_private_key_passwordNo收件人私钥的加密密码(原始字符串,未加密则留空)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden and does so well: structural parse success yields success even when decryption fails (decrypted=false + reason, tree still returned), AEAD mac length must equal declared aes-ICVlen, authAttrs become AAD per RFC 5083 §3, and BER features are surfaced. This is exactly the behavioral disclosure an agent needs for a mutation-free but failure-tolerant crypto tool.

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?

Uses clear 【算法】【参数】【输出】【注意】section headers with the purpose front-loaded in sentence one. It is dense and long, but for a multi-algorithm RFC-driven crypto tool nearly every clause (OAEP param reconstruction, CBC PKCS#7 vs GCM AEAD dispatch) earns its place; slight trimming of parenthetical RFC references is the only waste.

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 enumerates the return shape (decrypted, reason, plain_data_in_hex, version, wrap/CEA, recipients, ber_features, structure_tree) and explains the success/failure contract. Combined with full behavioral coverage despite absent annotations, an agent has everything needed to invoke and interpret this tool.

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 description coverage is 100%, so the baseline is 3, but the description adds real meaning: the private key is optional and its absence switches the tool to structure-only mode, and the password field is left blank for unencrypted keys. The 16MB size bound and explicit acceptance of KMS BER replies further clarify cms_in_hex beyond the schema text.

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 specific verb+resource: decrypt CMS EnvelopedData (RFC 5652 §6) / authEnvelopedData (RFC 5083) with BER/DER tolerance. The RFC citations and 'enveloped' qualifier make it clearly distinguishable from siblings like cms_enveloped_encrypt, cms_enveloped_parse, and cms_signed_verify without opening any 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?

Gives clear operational context: it reconstructs padding/content algorithms from the message declaration and does structural decomposition only when no private key is supplied ('不给则仅做结构拆解'). It also states a when-not case (GCM under EnvelopedData is undefined and rejected), but never names the sibling alternative (e.g. cms_enveloped_parse for structure-only work), so routing is inferred rather than explicit.

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.