Name

asn1parse

Synopsis

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.

Options

-inform PEM|DER

Specify the format of the input data, which may be either DER or PEM. The default is PEM.

-in filename

Specify the name of a file to read for input. The default is to read from stdin.

-out filename

Specify the name of a file to write output to. The default is to write to stdout.

-noout

Cause all output except for error messages to be suppressed.

-offset number

Specify the byte offset of the input data to start parsing at.

-length number

Specify the number of bytes to include in the parse.

-i

Cause the output to be indented for readability.

-oid filename

Specify the name of a file containing extra OID definitions. See Section below for more information on the format of this file.

-strparse offset

Cause the content octets starting at the specified byte offset to be parsed. This option may be specified multiple times.

-dump

Cause unknown data to be displayed in hexadecimal form.

-dlimit number

Specify the maximum number of bytes of unknown data to be displayed. The default is to display all of it.

Notes

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.