1unber(1)                        Version 0.9.28                        unber(1)
2
3
4

NAME

6       unber -- the ASN.1 BER Decoder
7

SYNOPSIS

9       unber [-1] [-iindent] [-m] [-p] [-sskip] [-thex-string] [-]
10       [input-filenames...]
11

DESCRIPTION

13       unber presents the internal structure of BER-encoded files as a human
14       readable text.  A single dash denotes the standard input.
15
16       (The DER and CER formats are subsets of the BER and are also
17       supported.)
18

OPTIONS

20       -1     Do not attempt to read the next BER structure after the first
21              one.  This may be useful if the input contains garbage past the
22              single BER sequence.  By default, unber continues decoding until
23              the end of file (input stream).
24
25       -i indent
26              Use the specified number of spaces for output indentation.
27              Default is 4 spaces.
28
29       -m     Generate shorter output while still preserving BER encoding
30              information.
31
32       -p     Do not attempt to pretty-print known ASN.1 types (BOOLEAN,
33              INTEGER, OBJECT IDENTIFIER, etc).  By default, some ASN.1 types
34              are converted into the text representation.
35
36              This option is required if the unber(1) output is used as an
37              input to enber(1).
38
39       -s skip
40              Ignore the first skip bytes in the input stream; useful for
41              stripping off lower level protocol framing data.
42
43       -t hex-string
44              Interpret the hex-string as a sequence of hexadecimal values
45              representing the start of BER TLV encoding.  Print the human
46              readable explanation.
47

XML FORMAT

49       unber dumps the output in the regular XML format which preserves most
50       of the information from the underlying binary encoding.
51
52       The XML opening tag format is as follows:
53
54       <tform O="off" T="tag" TL="t_len" V="{Indefinite|v_len}" [A="type"]
55       [F]>
56
57       Where:
58
59       tform  Encoding form the value is in: primitive ("P") or constructed
60              ("C") or constructed with indefinite length ("I")
61
62       off    Offset of the encoded element in the unber input stream.
63
64       tag    The tag class and value in human readable form.
65
66       t_len  The length of the TL (BER Tag and Length) encoding.
67
68       v_len  The length of the value (V, encoded by the L), may be
69              "Indefinite".
70
71       type   Likely name of the underlying ASN.1 type (for UNIVERSAL tags).
72
73       [F]    Indicates that the value was reformatted (pretty-printed).  This
74              will never appear in the output produced using the -p command
75              line option.
76
77   Example XML output:
78       <I O="0" T="[UNIVERSAL 16]" TL="2" V="Indefinite" A="SEQUENCE">
79        <P O="2" T="[UNIVERSAL 19]" TL="2" V="2" A="PrintableString">US</P>
80         <C O="6" T="[UNIVERSAL 16]" TL="2" V="6" A="SEQUENCE">
81           <P O="8" T="[UNIVERSAL 2]" TL="2" V="4" A="INTEGER" F>832970823</P>
82         </C O="14" T="[UNIVERSAL 16]" A="SEQUENCE" L="8">
83       </I O="14" T="[UNIVERSAL 0]" TL="2" L="16">
84

EXAMPLES

86       Decode the given Tag/Length sequence specified in hexadecimal form:
87
88              unber  -t "bf 20"
89
90       Decode the DER file using two-spaces indentation:
91
92              unber  -i 2  filename.der
93
94       Decode the binary stream taken from the standard input:
95
96              cat filename.der | unber -
97
98       Decode the binary stream and encode it back into an identical stream
99       (see enber(1)):
100
101              cat filename.der | unber -p - | enber - > filename.ber
102

FOOTNOTES

104       The constructed XML output is not necessarily well-formed.
105
106       When indefinite length encoding is being used, the BER sequence which
107       is not terminated with the end-of-content octets will cause the
108       terminating </I> XML tag to disappear.  Thus, invalid BER framing
109       directly causes invalid XML output.
110
111       The enber(1) utility understands such XML correctly.
112

SEE ALSO

114       enber(1), asn1c(1).
115

AUTHORS

117       Lev Walkin <vlm@lionet.info>.
118
119
120
121ASN.1 BER Decoder                 2016-01-23                          unber(1)
Impressum