In-memory representation of a single BER/DER ASN.1 TLV element. More...
#include <encoding.h>
Data Fields | |
| uint8_t | tagclass |
| bool | constructed |
| uint32_t | tagnumber |
| bool | indefinite |
| size_t | length |
| uint8_t * | value |
| struct qsc_encoding_ber_element ** | children |
| size_t | ccount |
In-memory representation of a single BER/DER ASN.1 TLV element.
An element is either:
value and length reflects their count. children is NULL and ccount is 0.value holds that block and length reflects its byte count. For elements produced by the decoder, children holds pointers to individually decoded child elements and length reflects the total content byte count (not including tag/length overhead of this element).indefinite is true. The decoder populates children with all elements found before the EOC marker; the encoder iterates children and appends the 0x00 0x00 EOC pair. DER rejects indefinite-length encoding at both encode and decode time.children array is heap-allocated and owned by this element. Always release element trees with qsc_encoding_ber_free_element to avoid memory leaks. | size_t ccount |
Number of valid pointers in children.
| struct qsc_encoding_ber_element** children |
Heap-allocated array of child element pointers; valid only for constructed types when decoded into individual child elements.
| bool constructed |
true if the element is constructed (contains child elements); false if primitive.
| bool indefinite |
true if the length was encoded in indefinite form (BER only); false for definite form.
| size_t length |
For primitive elements: number of bytes in value. For constructed elements: total content byte count (excluding the tag and length header of this node).
| uint8_t tagclass |
Tag class: one of QSC_ENCODING_BER_CLASS_UNIVERSAL, QSC_ENCODING_BER_CLASS_APPLICATION, QSC_ENCODING_BER_CLASS_CONTEXT_SPECIFIC, or QSC_ENCODING_BER_CLASS_PRIVATE.
| uint32_t tagnumber |
Tag number. Values < 31 use short-form tag encoding; values >= 31 use long-form (base-128).
| uint8_t* value |
Pointer to the raw value bytes for primitive elements, or the pre-encoded content block for definite-length constructed elements. NULL for constructed elements decoded from child streams.