Represents a BER (Basic Encoding Rules) 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 |
Represents a BER (Basic Encoding Rules) element.
This structure is used to represent an ASN.1 element encoded using BER. An element may be either:
The structure holds the tag class, the constructed flag, and the tag number. For primitive elements, value and length are used to represent the element's data. For constructed elements, the children pointer is used (typically during decoding), although in some cases the pre-encoded block is placed in value along with its length.
size_t ccount |
The number of child elements pointed to by the children array.
struct qsc_encoding_ber_element** children |
Array of pointers to child qsc_encoding_ber_element structures (used for constructed types when decoding into individual child elements).
bool constructed |
Flag indicating if the element is constructed (true) or primitive (false).
bool indefinite |
true if the element's length was encoded in the indefinite form, false if definite.
size_t length |
For definite-length encoding, the number of bytes in the value or in the pre-encoded block of child elements.
uint8_t tagclass |
Tag class (e.g., QSC_ENCODING_BER_CLASS_UNIVERSAL, BER_CLASS_APPLICATION, QSC_ENCODING_BER_CLASS_CONTEXT_SPECIFIC, or QSC_ENCODING_BER_CLASS_PRIVATE).
uint32_t tagnumber |
Tag number; may be greater than 30, which requires long-form encoding.
uint8_t* value |
Pointer to the element's raw value bytes. For primitive types, this holds the encoded data. For definite constructed types, it may hold a pre-encoded block.