Skip to main content
Glama

CipherHUB Cryptography Toolkit

cms_enveloped_encrypt

[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。

Input Schema

TableJSON 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

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and delivers unusually rich detail: the 【注意】 section states CEK and IV are CSPRNG-generated server-side and never echoed, and it specifies version numbering (2 with SKI, 0 otherwise) and the authEnvelopedData shape for GCM. It stops short of covering failure modes, error behavior, or persistence/reversibility.

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?

Headers (【算法】【参数】【输出】【注意】) make it scannable and front-loaded, and the RFC citations are precise rather than filler. It is longer than strictly needed, with some algorithm-spec prose that duplicates enum values already in the schema.

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?

There is no output schema and no annotations, so the description must explain the return shape — and it does, enumerating cms_in_hex, version, wrap/CEA OIDs, recipients digest, der_note, and structure_tree. Only the absence of error/auth-failure behavior keeps it from being fully complete.

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 goes beyond it — explaining OAEP internals (hashFunc + MGF1 same hash + empty pSource), the 12B nonce and tag placement for GCM, and the 1B~16MB plaintext range that the schema omits. It maps directly onto all four parameters.

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?

The opening names a specific verb and resource ('构造 CMS EnvelopedData 信封 (RFC 5652 §6, KeyTransRecipientInfo)'), with a bracketed [cms_enveloped] tag that cleanly separates it from cms_enveloped_decrypt and cms_enveloped_parse. An agent can identify the operation without opening the 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 description establishes clear context: you supply a recipient RSA certificate plus hex plaintext and get a wrapped envelope back. It does not, however, name when to prefer this over cms_signed_sign or cms_enveloped_parse, nor state any prerequisites/exclusions explicitly.

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.