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