Asn1Element

class Asn1Element(val tag: Asn1Tag, val rawValue: ByteArray, val children: List<Asn1Element>, val fullEncoding: ByteArray)(source)

Represents a parsed ASN.1 DER element (TLV — Tag, Length, Value).

For constructed types (SEQUENCE, SET, context-specific constructed), the children list contains the recursively parsed sub-elements. For primitive types, children is empty.

Constructors

Link copied to clipboard
constructor(tag: Asn1Tag, rawValue: ByteArray, children: List<Asn1Element>, fullEncoding: ByteArray)

Properties

Link copied to clipboard

Recursively parsed children; non-empty only for constructed types.

Link copied to clipboard

The complete TLV encoding (tag + length + value bytes).

Link copied to clipboard

Whether this element is a constructed type.

Link copied to clipboard

The raw value bytes (content octets, excluding tag and length bytes).

Link copied to clipboard

The ASN.1 tag of this element.

Functions

Link copied to clipboard
fun childAt(index: Int): Asn1Element?

Return the child at index, or null if out of bounds.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun findChild(childTag: Asn1Tag): Asn1Element?

Find the first child whose tag equals childTag, or null.

Link copied to clipboard

Find all children whose tag equals childTag.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String