xref: /freebsd/contrib/libder/README.md (revision dd3603749cb7f20a628f04d595b105962b21a3d2)
1# libder
2
3## What is libder?
4
5libder is a small library for encoding/decoding DER-encoded objects.  It is
6expected to be able to decode any BER-encoded buffer, and an attempt to
7re-encode the resulting tree would apply any normalization expected by a DER
8decoder.  The author's use is primarily to decode/encode ECC keys for
9interoperability with OpenSSL.
10
11The authoritative source for this software is located at
12https://git.kevans.dev/kevans/libder, but it's additionally mirrored to
13[GitHub](https://github.com/kevans91/libder) for user-facing interactions.
14Pull requests and issues are open on GitHub.
15
16## What is libder not?
17
18libder is not intended to be a general-purpose library for working with DER/BER
19specified objects.  It may provide some helpers for building more primitive
20data types, but libder will quickly punt on anything even remotely complex and
21require the library consumer to supply it as a type/payload/size triple that it
22will treat as relatively opaque (modulo some encoding normalization rules that
23can be applied without deeply understanding the data contained within).
24
25libder also doesn't do strict validation of what it reads in today, for better
26or worse.  e.g., a boolean may occupy more than one byte and libder will happily
27present it to the application in that way.  It would be normalized on
28re-encoding to 0xff or 0x00 depending on whether any bits are set or not.
29