Overview of libder
mainlibder is a lightweight library designed for encoding and decoding DER-encoded objects. Its primary use case is decoding and encoding ECC keys to ensure interoperability with OpenSSL.
Key characteristics:
- BER Compatibility: It is capable of decoding any BER-encoded buffer.
- Normalization: When re-encoding a decoded tree, libder applies DER normalization rules.
- Opaque Data Handling: For complex data types, libder expects the consumer to provide a type/payload/size triple, treating the payload as relatively opaque while still applying encoding normalization.
- Validation Model: The library does not perform strict validation of input. For example, a boolean might occupy multiple bytes in the input; libder will present it as-is, but will normalize it to
0xffor0x00upon re-encoding based on whether any bits are set.