libasn is a general purpose library implementing very useful functionality, including features such as:

  • Programming aids
    • Manual memory management and garbage collection mechanism (mmatic)
    • Process forking and execution with pipes
    • Regex matching functions (using pcre library)
    • Application level debug information handling system
  • Data structures
    • Linked lists (tlist)
    • Hash tables (thash)
    • Safe strings (xstr)
    • Wide-char (multi-byte) strings (wstr)
    • Universal variable type (ut) combining many types to represent arbitrary data structures on runtime
  • Algorithms
    • Topological sort (tsort)
  • Parsers / serializers
  • Encoders / decoders
  • Ciphers

libasn is ASN Labs swiss army knife, used in almost all of its userspace applications.


You can get the latest, development version source code from our git repository.

If you are an Arch Linux user, you can easily find this package in the Arch Linux User Repository (AUR) - thanks go to Henri Häkkinen for preparing and uploading the package. Dive in here for more details.

You can also see all previous stable versions here.

Source Code

You can check out libasn source code using our GitWeb interface or by simply cloning our repository to your computer. It's as simple as writing:

git clone git://

in your console, provided that you have the git package installed. Of course you can modify and use libasn at will, as long as you obey the rules of the GNU Public License version 3. We highly encourage you to participate in the development of this library as well - feel free to send us useful patches and links to your branches, and we will consider merging the changes with our main repository. Please feel free to contact the ASNlibs project maintainer for this purpose - Łukasz 'sil2100' Zemczak.


  1. Getting started with libasn
  2. Using the libasn library?
  3. Examples

For more specific information about libasn API, see our doxygen generated documentation or the source code headers. Our web hosted doxygen documentation is updated daily from our main git repository, so it is most likely always up-to-date with the latest revision. If you are interested in documentation for the current, stable version, please consult the source code headers from the tarball.