LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

asn1parse.1s

Parse and display ASN.1 encoded data

TLDR

Parse ASN.1 data
$ openssl asn1parse -in [file.der]
copy
Parse PEM encoded file
$ openssl asn1parse -in [file.pem] -inform PEM
copy
Parse with offset
$ openssl asn1parse -in [file.der] -offset [100]
copy
Show structure with hex dump
$ openssl asn1parse -in [file.der] -dump
copy
Parse nested ASN.1 structure at a given offset
$ openssl asn1parse -in [file.pem] -strparse [offset]
copy

SYNOPSIS

openssl asn1parse [-help] [-inform DER|PEM] [-in filename] [-out filename] [-noout] [-offset number] [-length number] [-i] [-dump] [-dlimit num] [-strparse offset] [-genstr string] [-genconf file] [-strictpem]

DESCRIPTION

asn1parse is an OpenSSL diagnostic utility that parses ASN.1 (Abstract Syntax Notation One) encoded data. It displays the structure of certificates, keys, and other cryptographic objects in a human-readable format.The tool is invaluable for debugging certificate issues, understanding data structures, and analyzing encoded data.

PARAMETERS

-help

Print usage message.
-in filename
Input file, default is standard input.
-inform DER|PEM
Input format; the default is PEM.
-out filename
Output file to place the DER encoded data into.
-noout
Don't output the parsed version of the input file.
-offset number
Starting offset to begin parsing, default is start of file.
-length number
Number of bytes to parse, default is until end of file.
-i
Indent the output according to the depth of the structures.
-dump
Dump unknown data in hex format.
-dlimit num
Like -dump, but only the first num bytes are output.
-strparse offset
Parse the contents octets of the ASN.1 object starting at offset.
-genstr string
Generate encoded data based on string using ASN1generatenconf format.
-genconf file
Generate encoded data from file using ASN1generatenconf format.
-strictpem
Ignore any data prior to the BEGIN marker or after END marker in PEM.

CAVEATS

Requires understanding of ASN.1 structure. Output can be verbose for complex objects. Mainly for debugging, not routine use.

HISTORY

asn1parse is part of OpenSSL, which has been the standard cryptographic toolkit since the late 1990s.

SEE ALSO

Copied to clipboard
Kai