asn1parse
The asn1parse
command is a diagnostic utility that
parses ASN.1 structures. It can also be used to extract data from
ASN.1-formatted data.
Specify the format of the input data, which may be either DER or PEM. The default is PEM.
Specify the name of a file to read for input. The default is to read
from stdin.
Specify the name of a file to write output to. The default is to
write to stdout.
Cause all output except for error messages to be suppressed.
Specify the byte offset of the input data to start parsing at.
Specify the number of bytes to include in the parse.
Cause the output to be indented for readability.
Specify the name of a file containing extra OID definitions. See Section below for more information on the format of this file.
Cause the content octets starting at the specified byte offset to be parsed. This option may be specified multiple times.
Cause unknown data to be displayed in hexadecimal form.
Specify the maximum number of bytes of unknown data to be displayed. The default is to display all of it.
Data in the ASN.1 format is composed of objects, some with an
assigned object identifier (OID). An object identifier is a sequence
of numbers that is normally represented by separating each number in
the sequence with a period. Because object identifiers are often
composed of many numbers, they can be difficult to remember. For this
reason, object identifiers are given names. OpenSSL defines many
object identifiers internally and displays them with their names, but
if an unknown object identifier is encountered, it is represented by
this command in its numerical form. The oid option
allows you to specify the name of a file that additional OID
definitions will be read from so that they may be displayed using
their names when they’re encountered by this
command.
The format of a file containing object identifier definitions is
quite simple. Each OID definition appears on its own line and
consists of three columns. The first column is the numerical
representation of the OID. The second column is a short name of the
OID, which should be a single word composed of only upper- and
lowercase letters. The third column is a long name of the OID, which
may contain multiple words and characters other than letters. The
long name is the name that will be displayed by the
asn1parse command.