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