Skip to main content
Glama

CipherHUB Cryptography Toolkit

cms_enveloped_encrypt

Read-only

[cms_enveloped] 构造 CMS EnvelopedData 信封(RFC 5652 §6,KeyTransRecipientInfo)。 【算法】密钥封装 RSAES-OAEP(RFC 8017 / RFC 3560 参数:hashFunc + MGF1 同哈希 + 空 pSource)或 RSAES-PKCS1-v1_5;内容加密 AES-128/256-CBC (RFC 3565,PKCS#7 填充)或 AES-128/256-GCM(RFC 5084 只为 authEnvelopedData 定义 GCM:RFC 5083 形态,version 恒 0、tag 独立 放 mac 字段、nonce 12B、aes-ICVlen 声明在参数里)。 【参数】

  • recipient_certificate_in_pem:收件人 RSA 证书 PEM

  • key_wrap_algorithm:RSAES_OAEP_SHA_256(默认)/ SHA_1 / SHA_224 / SHA_384 / SHA_512 / RSAES_PKCS1_V1_5

  • content_encryption_algorithm:AES256_CBC(默认)/ AES128_CBC / AES256_GCM / AES128_GCM

  • plain_data_in_hex:明文(1B~16MB) 【输出】cms_in_hex(DER 定长编码)、version、wrap/CEA 的 OID、 recipients 摘要(rid 类型/SKI 或 issuer+serial)、der_note、 structure_tree(ASN.1 TLV 拆解树)。 【注意】CEK 与 IV 服务端 CSPRNG 生成、永不回显;证书带 SKI 扩展时 rid=SKI、version=2(与 AWS KMS 回包同构),否则 issuerAndSerial、 version=0。

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

Input Schema

NameRequiredDescriptionDefault
plain_data_in_hexNo明文的十六进制字符串
key_wrap_algorithmNo密钥封装算法,可选值:RSAES_OAEP_SHA_256 / RSAES_OAEP_SHA_1 / RSAES_OAEP_SHA_224 / RSAES_OAEP_SHA_384 / RSAES_OAEP_SHA_512 / RSAES_PKCS1_V1_5RSAES_OAEP_SHA_256
content_encryption_algorithmNo内容加密算法,可选值:AES256_CBC / AES128_CBC(RFC 3565)/ AES256_GCM / AES128_GCM(RFC 5084,产出 authEnvelopedData 形态 RFC 5083)AES256_CBC
recipient_certificate_in_pemNo收件人 RSA 证书的 PEM 文本(含 BEGIN/END CERTIFICATE 头尾)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

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

Beyond readOnlyHint=true and openWorldHint=false, the description discloses meaningful behavior: CEK and IV are generated server-side by CSPRNG and never echoed back, GCM output takes the authEnvelopedData form with version 0 and a separate mac tag, and rid is SKI-based (version 2) when the certificate carries a SKI extension. That goes well past what the annotations convey; only failure modes are left unstated.

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

Conciseness3/5

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

The 【算法】/【参数】/【输出】/【注意】 structure is legible and the purpose is front-loaded. But the 【参数】 block largely restates the schema whose coverage is 100%, making that section redundant, and the algorithm prose is dense enough to slow 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?

With no output schema, the description compensates by enumerating cms_in_hex, version, wrap/CEA OIDs, recipient summary, der_note, and structure_tree. It also explains the version/SKI rule that determines output shape. Only error conditions and cross-tool workflow (feed the DER to decrypt or asn1_parse) are absent.

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 already 100%, but the description still adds value the schema lacks: the 1B~16MB plaintext size limit, the concrete OAEP parameters (MGF1 with the same hash, empty pSource), and the GCM encoding specifics (12-byte nonce, aes-ICVlen declared in parameters). Both enum-bearing parameters get rationale rather than a mere value list.

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?

The opening sentence states a specific verb and resource: construct a CMS EnvelopedData envelope per RFC 5652 §6 with KeyTransRecipientInfo. That is precise enough to separate it from cms_enveloped_decrypt and cms_enveloped_parse, though it never names those siblings or explicitly frames itself as the inverse of decrypt.

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 constraints are implied through the algorithm matrix (which wrap/CEA combinations are valid, what GCM produces), and the 1B~16MB plaintext bound is stated. However, there is no explicit 'use this when' guidance, no prerequisites such as requiring an RSA recipient certificate, and no routing to decrypt/parse for the reverse operation.

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.