Skip to main content
Glama

CipherHUB Cryptography Toolkit

cms_enveloped_decrypt

Read-only

[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 信封可直接喂入。

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_decrypt"
  }
}

Input 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.1/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld annotations: it discloses that structural parse success is reported as success even when decryption fails, that failures surface as decrypted=false plus reason with the tree still returned, and that GCM under plain EnvelopedData is rejected outright. These are exactly the non-obvious behaviors an agent needs before invoking it.

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-loads purpose, then organizes detail under labeled blocks (algorithm, parameters, output, cautions). It is dense but every section carries information; the parameter block partly restates schema descriptions, which 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?

With no output schema, the description enumerates the return fields (decrypted, reason, plain_data_in_hex, version, wrap/CEA, recipients, ber_features, structure_tree) and explains the success/failure contract. Nothing needed to call this tool correctly is missing.

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 100%, so the baseline is 3, but the description adds real meaning: the private key is optional and omitting it degrades to structure-only parsing, and the password is blank when the key is unencrypted. It also pins the 16MB bound on the hex input.

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?

Starts with a precise verb+resource: decrypting CMS EnvelopedData (RFC 5652 §6) and authEnvelopedData (RFC 5083), with BER/DER tolerance. It is clearly distinct from cms_enveloped_encrypt by polarity, but it never names cms_enveloped_parse or explains how the optional private key's 'structure-only' mode differs from that sibling.

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?

Usage is implied by the description and a real use case is flagged (AWS KMS BER responses can be fed directly), but there is no explicit statement of when to prefer cms_enveloped_parse or cms_enveloped_encrypt instead, and no prerequisites for the key material.

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.