1
1
mirror of https://github.com/wader/fq.git synced 2024-11-27 06:04:47 +03:00
fq/format/asn1/testdata/test.pem.fqtest
Mattias Wadman 051a70bd4b interp: Change bit ranges to use exclusive end
All other ranges and slicing uses exclusive end so i think it make sense
to make it consistent.

Update docs and add additional example for non-byte-aligned field.

Also fixes issue showing zero bit ranges as start-NA.
2023-10-20 15:37:26 +02:00

57 lines
4.9 KiB
Plaintext

$ fq -d bytes 'from_pem | asn1_ber | dv, torepr' test.pem
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: (asn1_ber) 0x0-0xa2 (162)
0x00|30 |0 | class: "universal" (0) 0x0-0x0.2 (0.2)
0x00|30 |0 | form: "constructed" (1) 0x0.2-0x0.3 (0.1)
0x00|30 |0 | tag: "sequence" (0x10) 0x0.3-0x1 (0.5)
0x00| 81 9f | .. | length: 159 0x1-0x3 (2)
| | | constructed[0:2]: 0x3-0xa2 (159)
| | | [0]{}: object 0x3-0x12 (15)
0x00| 30 | 0 | class: "universal" (0) 0x3-0x3.2 (0.2)
0x00| 30 | 0 | form: "constructed" (1) 0x3.2-0x3.3 (0.1)
0x00| 30 | 0 | tag: "sequence" (0x10) 0x3.3-0x4 (0.5)
0x00| 0d | . | length: 13 0x4-0x5 (1)
| | | constructed[0:2]: 0x5-0x12 (13)
| | | [0]{}: object 0x5-0x10 (11)
0x00| 06 | . | class: "universal" (0) 0x5-0x5.2 (0.2)
0x00| 06 | . | form: "primitive" (0) 0x5.2-0x5.3 (0.1)
0x00| 06 | . | tag: "object_identifier" (0x6) 0x5.3-0x6 (0.5)
0x00| 09 | . | length: 9 0x6-0x7 (1)
| | | value[0:7]: 0x7-0x10 (9)
0x00| 2a | * | [0]: 1 oid 0x7-0x8 (1)
0x00| 2a | * | [1]: 2 oid 0x7-0x8 (1)
0x00| 86 48 | .H | [2]: 840 oid 0x8-0xa (2)
0x00| 86 f7 0d | ... | [3]: 113549 oid 0xa-0xd (3)
0x00| 01 | . | [4]: 1 oid 0xd-0xe (1)
0x00| 01 | . | [5]: 1 oid 0xe-0xf (1)
0x00| 01| .| [6]: 1 oid 0xf-0x10 (1)
| | | [1]{}: object 0x10-0x12 (2)
0x10|05 |. | class: "universal" (0) 0x10-0x10.2 (0.2)
0x10|05 |. | form: "primitive" (0) 0x10.2-0x10.3 (0.1)
0x10|05 |. | tag: "null" (0x5) 0x10.3-0x11 (0.5)
0x10| 00 | . | length: "indefinite" (0) 0x11-0x12 (1)
| | | value: null
| | | [1]{}: object 0x12-0xa2 (144)
0x10| 03 | . | class: "universal" (0) 0x12-0x12.2 (0.2)
0x10| 03 | . | form: "primitive" (0) 0x12.2-0x12.3 (0.1)
0x10| 03 | . | tag: "bit_string" (0x3) 0x12.3-0x13 (0.5)
0x10| 81 8d | .. | length: 141 0x13-0x15 (2)
0x10| 00 | . | unused_bits_count: 0 0x15-0x16 (1)
0x10| 30 81 89 02 81 81 00 cc 61 f9| 0.......a.| value: raw bits 0x16-0xa2 (140)
0x20|ef 5a d0 bc 21 de 5b 3c a6 9e e7 25 d2 c5 04 ed|.Z..!.[<...%....|
* |until 0xa1.7 (end) (140) | |
[
[
[
1,
2,
840,
113549,
1,
1,
1
],
null
],
"0\ufffd\ufffd\u0002\ufffd\ufffd\u0000\ufffda\ufffd\ufffdZм!\ufffd[<\ufffd\ufffd\ufffd%\ufffd\ufffd\u0004\ufffd\ufffd\ufffdn\ufffd\ufffd'\ufffd\ufffd\ufffd#d\ufffd!\ufffd\ufffd\ufffdpER\ufffdѣ޲\ufffd\u001a\u000b\ufffdU\ufffd<\ufffd\ufffd\ufffd\u001a\ufffd\u00149+m\ufffd#F\ufffd|\ufffd\ufffdu\ufffd\ufffd+\ufffd'\ufffd\ufffd\u001f\\\ufffd\ufffd4\ufffd\u0011\u000e\ufffd\ufffdr\ufffd\ufffds\ufffd\ufffd8\ufffd\ufffd\ufffd\ufffd9\ufffd\ufffd\ufffd\ufffd4\u0011\ufffd\ufffd±\ufffd\ufffd\ufffd\ufffdQ;\u0005e\b\ufffd\b\ufffdCɛ\f\ufffd\",\ufffd\ufffd\ufffd\u0002\u0003\u0001\u0000\u0001"
]