Skip to main content
Glama

CipherHUB Cryptography Toolkit

der_encode

[structured_message] 把 JSON 节点 DSL 编码为 DER 字节(X.690)。 【算法】DER 规范编码(定长最短 + SET OF 排序);或教学 BER 不定长 (构造容器 0x80 + EOC,复刻 AWS KMS 回包形态)。 【参数】

  • json_payload:节点 DSL(≤65536 字符),一节点一主键: {"integer": n}/{"enumerated": n}/{"boolean": true}/{"null": true}; {"oid": "1.2.840…"}(首弧 0/1 时次弧≤39); {"octet_string": ""}/{"bit_string": {"hex","unused_bits":0..7}}; {"utf8_string"|"printable_string"|"ia5_string"|"numeric_string": s}; {"utc_time": "YYMMDDHHMMSSZ"}/{"generalized_time": "YYYYMMDDHHMMSS[.f]Z"}; {"sequence": [节点]}/{"set": [节点]}; {"context"|"application"|"private": {"number": n, "children": [节点]|"primitive_hex": ""}}(children=[单节点] 即 EXPLICIT、[内层孩子们] 即 IMPLICIT-constructed); {"raw": {"tag_hex", "content_hex"}}(逃生舱)

  • der:True=规范 DER(SET OF 按 X.690 §11.6 完整子 TLV 字节排序)

  • ber_indefinite:True=构造容器不定长 BER(原语保持定长,§8.1.3.4) 【输出】encoded_in_hex、encoded_length、der、der_conformant、ber_features、 structure_tree(编码输出回剖的免费拆解树)、truncated、warnings。 【注意】der 与 ber_indefinite 互斥;两者皆 false 为定长 + SET OF 作者序的 教学 BER 态;时间只收线上原格式(不做 ISO 便捷转换)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
derNoTrue=规范 DER(X.690 §10 定长最短 + SET OF 按 §11.6 排序);与 ber_indefinite 互斥
json_payloadNo待编码的结构化消息 JSON 文本(≤65536 字符)。CBOR:{"$bytes":"<hex>"} 渲染 byte string、{"$tag":n,"value":…} 渲染 tagged value;DER:ASN.1 节点 DSL(一节点一主键,如 {"sequence":[{"oid":"1.2…"}]},形态清单见 der_encode 工具描述)
ber_indefiniteNoTrue=构造容器不定长 BER(0x80 + 两字节 EOC 递归,原语保持定长;AWS KMS 回包同款形态)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it does so thoroughly. It explains the encoding algorithm, SET OF sorting behavior, indefinite-length construction with 0x80 + EOC, constraints on OID arcs and time formats, the raw escape hatch, and the mutually exclusive modes. It also lists output fields such as der_conformant, structure_tree, truncated, and warnings, giving the agent a clear picture of what will happen.

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?

The description is long but well organized into labeled sections: algorithm, parameters, output, and notes. The core purpose is front-loaded, and each section earns its place given the complexity of the tool. Minor redundancy with the input schema description prevents a 5, but the structure is appropriate for the subject matter.

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?

For a tool with no output schema and no annotations, the description covers the critical calling context: input DSL forms, encoding modes, mutual exclusion, constraints, and output field names. It stops short of fully defining the semantics of every output field or error behavior, but it is complete enough for an agent to invoke the tool correctly and interpret the main results.

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?

The input schema already provides 100% parameter coverage with detailed descriptions, so the baseline is 3. The description adds value beyond the schema by giving concrete DSL examples, explaining explicit vs implicit constructed forms, clarifying the meaning of both-false mode, and specifying constraints like OID arc limits and unused_bits range. This goes beyond the schema's own documentation.

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 description opens with a specific verb and resource: '把 JSON 节点 DSL 编码为 DER 字节(X.690)'. It immediately distinguishes DER encoding from decoding or other encodings and further clarifies the two BER/DER modes. The purpose is unmistakable even 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly explains when to use DER mode, BER indefinite mode, or the teaching BER mode, and states that der and ber_indefinite are mutually exclusive. However, it never explicitly compares this tool with sibling tools such as cbor_encode or asn1_parse, so guidance for choosing this tool over alternatives is only implied rather than stated.

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.