class

ASN1::BER::Identifier

Inherits BinData / Reference / Object

The leading identifier octet of a BER element (tag class, constructed flag and tag number), plus any high-tag-number continuation bytes.

Constants

AFTER_DESERIALIZE = [] of Nil

The leading identifier octet of a BER element (tag class, constructed flag and tag number), plus any high-tag-number continuation bytes.

BEFORE_SERIALIZE = [] of Nil

The leading identifier octet of a BER element (tag class, constructed flag and tag number), plus any high-tag-number continuation bytes.

ENDIAN = ["big"]

The leading identifier octet of a BER element (tag class, constructed flag and tag number), plus any high-tag-number continuation bytes.

KLASS_NAME = [ASN1::BER::Identifier]

The leading identifier octet of a BER element (tag class, constructed flag and tag number), plus any high-tag-number continuation bytes.

MAX_EXTENDED_BYTES = 16

Cap on high-tag-number continuation bytes, to bound read against a stream of more-flagged bytes (otherwise the array grows without limit). 16 base-128 bytes encode a tag number well beyond any real-world use.

PARTS = [{type: "bitfield", name: 1, cls: ASN1::BER::Identifier, onlyif: nil, verify: nil, endian: IO::ByteFormat::BigEndian}] of Nil

The leading identifier octet of a BER element (tag class, constructed flag and tag number), plus any high-tag-number continuation bytes.

REMAINING = [] of Nil

The leading identifier octet of a BER element (tag class, constructed flag and tag number), plus any high-tag-number continuation bytes.

Class methods

bit_fields

The leading identifier octet of a BER element (tag class, constructed flag and tag number), plus any high-tag-number continuation bytes.

Source

Instance methods

__format__

A group or bit_field captures the endianness at its declaration point, so declaring endian after one would silently leave it system-endian. Fail loudly.

Source
constructed
Source
constructed=(constructed : UInt8)
constructed=(value : Bool)
Source
extended
Source
extended=(extended : Array(ExtendedIdentifier))
Source
extended?
Source
read(io : IO) : IO

Reads the fields of this instance from io, in declaration order, and returns io. Raises BinData::ParseError (or BinData::VerificationException) on malformed input.

Source
tag_class
Source
tag_class=(tag_class : UInt8)
tag_class=(value : ASN1::BER::TagClass)
Source
tag_number
tag_number=(tag_number : UInt8)
write(io : IO)

Writes the fields of this instance to io in declaration order. Raises BinData::WriteError (or BinData::VerificationException) on failure.

Source