Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config.log
config.status
configure
configure~
clu_src/config.h.in*
wolfclu/config.h.in*
*.lo
*.Plo
*.o
Expand Down
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ man_MANS+= manpages/wolfssl-hash.1
man_MANS+= manpages/wolfssl-enc.1
man_MANS+= manpages/wolfssl-ca.1
man_MANS+= manpages/wolfssl-x509.1
man_MANS+= manpages/wolfssl-asn1parse.1
man_MANS+= manpages/wolfssl-req.1
man_MANS+= manpages/wolfssl-verify.1
man_MANS+= manpages/wolfssl-crl.1
Expand Down Expand Up @@ -95,6 +96,7 @@ include tests/dsa/include.am
include tests/pkey/include.am
include tests/dgst/include.am
include tests/rand/include.am
include tests/asn1/include.am
include tests/base64/include.am
include tests/ocsp/include.am
include tests/ocsp-scgi/include.am
Expand Down
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ AC_ARG_ENABLE([manpages],

AM_CONDITIONAL([ENABLE_MANPAGES], [test "x$ENABLED_MANPAGES" != "xno"])

# OID Name Table Build
ENABLED_OIDTABLE_DEFAULT=no
AC_ARG_ENABLE([oid-table],
[AS_HELP_STRING([--enable-oid-table],[Enable OID-to-name lookup table (default: disabled)])],
[ ENABLED_OIDTABLE=$enableval ],
[ ENABLED_OIDTABLE=$ENABLED_OIDTABLE_DEFAULT ]
)

if test "$ENABLED_OIDTABLE" = "yes"
then
AM_CFLAGS="$AM_CFLAGS -DHAVE_OID_TABLE"
fi


#wolfssl
AC_MSG_CHECKING([for wolfSSL])
Expand Down Expand Up @@ -198,3 +211,4 @@ echo " * C Compiler: $CC_VERSION"
echo " * C Flags: $CFLAGS"
echo " * CPP Flags: $CPPFLAGS"
echo " * LIB Flags: $LIB"
echo " * OID Name Table: $ENABLED_OIDTABLE"
87 changes: 87 additions & 0 deletions manpages/wolfssl-asn1parse.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
.\" Manpage for wolfssl asn1parse.
.\" Contact facts@wolfssl.com to correct errors or typos.
.TH wolfSSL SSL1 "June 2026" "0.2.0" "wolfssl asn1parse man page"
.SH NAME
wolfssl-asn1parse, asn1parse \- ASN.1 parsing utility
.SH SYNOPSIS
wolfssl asn1parse [-in file] [-inform DER|PEM|B64] [-out file] [-oid file] [-offset n] [-length n] [-strparse n[,n...]] [-i] [-dump] [-noout] [-help]
.SH DESCRIPTION
Parses an ASN.1 encoded structure (for example a certificate, key, or CRL)
and prints a human readable listing of its tags, lengths, and contents.
Input may be read in DER, PEM, or Base64 form.
.SH GENERAL OPTIONS
-help print the asn1parse help summary and exit.
.br
.LP
-oid file file of extra OID definitions. Each line uses the
.br
format: <oid> <shortName> <long name with spaces>.
.br
To use the built in OID table, configure wolfCLU with
.br
--enable-oid-table.
.SH I/O OPTIONS
-in file input file to read the ASN.1 structure from.
.br
.LP
-inform DER|PEM|B64 input file format. One of DER, PEM, or B64 (Base64).
.br
.LP
-out file output file for the ASN.1 DER data after processing.
.br
Best used with -strparse.
.br
.LP
-noout do not print the parsed output.
.br
.LP
-offset n offset into the file at which to begin parsing.
.br
.LP
-length n number of bytes to parse.
.br
.LP
-strparse n[,n...] offset to an OCTET/BIT STRING to parse. A comma
.br
separated list may be given, e.g. -strparse 702,64.
.SH FORMATTING OPTIONS
-i indent the output according to structure depth.
.br
.LP
-dump print unknown data in hex form.
.SH OUTPUT
Each line is formatted as:
.RS
0: 4 [1187] (0) SEQUENCE
.RE
.LP
where the first number is the offset, the second is the header length, the
value in brackets is the data length, and the value in parentheses is the
depth. Brackets indicate constructed types and a plus indicates a primitive
type.
.SH EXAMPLES
Parse a DER encoded certificate with indented output:
.RS
wolfssl asn1parse -inform DER -in cert.der -i
.RE
.LP
Parse a PEM file and dump unknown data as hex:
.RS
wolfssl asn1parse -in cert.pem -inform PEM -dump
.RE
.SH SEE ALSO
.BR wolfssl-x509(1) ", " wolfssl-req(1)
.SH NOTES
Available only when wolfSSL is built with WOLFSSL_ASN_PRINT and without
NO_FILESYSTEM. The -oid option additionally requires object id encoding
support (NO_WC_ENCODE_OBJECT_ID must not be defined). For OpenSSL
compatibility the tool reserves additional flags (e.g. -genstr, -genconf,
-item, -strictpem, -dlimit) that are not yet implemented.
.SH BUGS
No known bugs at this time.
.SH AUTHOR
wolfSSL, Inc. (facts@wolfssl.com)
.SH COPYRIGHT
Copyright 2026 wolfSSL Inc. All rights reserved.
.SH REPORTING BUGS
Report wolfssl bugs to support@wolfssl.com
Loading
Loading