The OSS TLV Print Utility, osstlv ( osstlv.exe on Windows), is a program that takes a BER, DER, or CER encoding in ASCII or binary format from an input file and writes it to an output file in one of three different type-length-value (TLV) formats.
BER/DER/CER encodings can be printed in any one of the following formats: hexadecimal-TLV, decomposed-TLV, or syntax-TLV. These formats are described in TLV Formats below.
NOTE: OSS TLV is only available on common platforms like Linux, Windows, and Solaris, and may not be available for your embedded system port. If you are interested in OSS TLV for your platform, contact OSS Nokalva Sales.
osstlv [-b|-t] <input> [+off[,num]] [-dec|-hex|-syn] [-out <output>] [-notitles] [-noaddition] [-pad <byte>] [-noshort]
[-nocdrheaders] [-help]
Keyword options, except -help, can be abbreviated to the fewest number of letters needed to uniquely identify them. For example, -binary can be abbreviated to -b.
osstlv -b foo.dat -nos -o out.txt
osstlv -t foo.txt -s -noa
osstlv -b foo.dat -d -noaWithout -noa a line can be printed as:
18:d= 3 hl=2 l= 9 prim: REAL :{2365,10,28} (2.365000E+031)
With -noa the same line would be printed as:
18:d= 3 hl=2 l= 9 prim: REAL :{2365,10,28}osstlv foo.dat -pad 0x00
30 80
A1 80
00 00
00 00
Padding byte '0x00' detected, skipping 6 bytes ...
000000000000
Concatenated record #2 detected, printing ...
30 80
A1 80
00 00
00 00
Padding byte '0x00' detected, skipping 6 bytes ...
000000000000BER/DER/CER encodings can be printed in any one of the following formats:
View a BER/DER/CER encoding in hexadecimal format with type, length, and value information separated from each other by spaces or newlines. All nested encodings are printed in an indented manner. Length values of 80 (hex) are not the true length of the value, but indicate that the encoding is indefinite in length, and that the occurrence of matching end-of-contents octets (00 00) indicates the end of the value.
Example
Definite length encoding:
30 2A
30 06
02 01 0A
01 01 FF
30 00
30 1E
09 09 803509540A2BE520DF
17 11 3932303432333137343333342D30373030
Indefinite length encoding:
30 80
30 80
02 01 0A
01 01 FF
00 00
30 80
00 00
30 80
09 09 803509540A2BE520DF
17 11 3932303432333137343333342D30373030
00 00
00 00
View a BER/DER/CER encoding in a format that lends itself to post-processing. The structure of each output line is
<offset>:d=<lvl> hl=<head> l=<len> {prim | cons}: <type> :<contents>
where
Example
Definite length encoding:
0:d= 1 hl=2 l= 42 cons: SET
2:d= 2 hl=2 l= 6 cons: SET
4:d= 3 hl=2 l= 1 prim: INTEGER :10 (0x0a)
7:d= 3 hl=2 l= 1 prim: BOOLEAN :TRUE
10:d= 2 hl=2 l= 0 cons: SET
12:d= 2 hl=2 l= 30 cons: SET
14:d= 3 hl=2 l= 9 prim: REAL :{2365,10,28} (2.365000E+031)
25:d= 3 hl=2 l= 17 prim: UTCTime :920423174334-0700
Indefinite length encoding:
0:d= 1 hl=2 l=-128 cons: SET
2:d= 2 hl=2 l=-128 cons: SET
4:d= 3 hl=2 l= 1 prim: INTEGER :10 (0x0a)
7:d= 3 hl=2 l= 1 prim: BOOLEAN :TRUE
10:d= 3 hl=2 l= 0 prim: END-OF-CONTENTS
12:d= 2 hl=2 l=-128 cons: SET
14:d= 3 hl=2 l= 0 prim: END-OF-CONTENTS
16:d= 2 hl=2 l=-128 cons: SET
18:d= 3 hl=2 l= 9 prim: REAL :{2365,10,28} (2.365000E+031)
29:d= 3 hl=2 l= 17 prim: UTCTime :920423174334-0700
48:d= 3 hl=2 l= 0 prim: END-OF-CONTENTS
50:d= 2 hl=2 l= 0 prim: END-OF-CONTENTS
Outputs Type, Length, and Contents fields that are similar to the format used in X.690 to show examples of encodings, where
Example
Definite length encoding:
Type Length Contents
SET 42
Type Length Contents
SET 6
Type Length Contents
INTEGER 1 10 (0x0a)
BOOLEAN 1 TRUE
SET 0
SET 30
Type Length Contents
REAL 9 {2365,10,28} (2.365000E+031)
UTCTime 17 920423174334-0700
Indefinite length encoding:
Type Length Contents
SET indef
Type Length Contents
SET indef
Type Length Contents
INTEGER 1 10 (0x0a)
BOOLEAN 1 TRUE
END-OF-CONTENTS
SET indef
END-OF-CONTENTS
SET indef
Type Length Contents
REAL 9 {2365,10,28} (2.365000E+031)
UTCTime 17 920423174334-0700
END-OF-CONTENTS
END-OF-CONTENTS
One of the following error messages is generated when an error occurs while parsing the command line:
One of the following error messages is generated when an error occurs while parsing an input BER/DER/CER encoding:
This documentation applies to the latest versions of the OSS® ASN.1 Tools software.
Copyright © 2025 OSS Nokalva, Inc. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means electronic, mechanical, photocopying, recording or otherwise, without the prior permission of OSS Nokalva, Inc.
Every distributed copy of the OSS® ASN.1 Tools is associated with a specific license and related unique license number. That license determines, among other things, what functions of the OSS ASN.1 Tools are available to you.