class

ASN1::BER

Inherits BinData < Reference < Object

Constants

ENDIAN = ["big"]
KLASS_NAME = [ASN1::BER]
PARTS = [{type: "basic", name: identifier, cls: ASN1::BER::Identifier, onlyif: nil, verify: nil, value: nil}, {type: "basic", name: length, cls: ASN1::BER::Length, onlyif: nil, verify: nil, value: nil}] of Nil
REMAINING = [] of Nil

Class methods

bit_fields
Source

Instance methods

__format__
Source
children

Extracts children from the payload

Source
children=(parts)
Source
constructed
Source
constructed=(custom : Bool)
Source
extended
Source
extended=(parts : Array(ExtendedIdentifier))
Source
extended?
Source
get_bitstring
Source
get_boolean
Source
get_bytes

Returns the raw bytes

Source
get_hexstring(universal = true, tag = UniversalTags::OctetString)

Gets a hex representation of the bytes

Source
get_integer(check_tags = {UniversalTags::Integer, UniversalTags::Enumerated}, check_class = TagClass::Universal) : Int64
Source
get_integer_bytes
Source
get_object_id

Returns the object ID in string format

Source
get_string

Returns a UTF8 string

Source
identifier

Components of a BER object

identifier=(identifier : Identifier)

Components of a BER object

inspect(io : IO) : Nil

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Source
length
length=(length : Length)
payload
Source
payload=(payload : Bytes)
Source
read(io : IO) : IO
Source
sequence?

Check if this can be expanded into multiple sub-entries

Source
set_boolean(value)
Source
set_bytes(data, tag = UniversalTags::OctetString, tag_class = TagClass::Universal)
Source
set_hexstring(string, tag = UniversalTags::OctetString, tag_class = TagClass::Universal)

Sets bytes from a hexstring

Source
set_integer(value, tag = UniversalTags::Integer, tag_class = TagClass::Universal)

ameba:disable Metrics/CyclomaticComplexity

Source
set_object_id(oid)

Sets a string representing an object ID

Source
set_string(string, tag = UniversalTags::UTF8String, tag_class = TagClass::Universal)

Sets a UTF8 string

Source
size
Source
tag_class
Source
tag_class=(tag : TagClass)
Source
tag_number
Source
tag_number=(tag_type : Int | UniversalTags)
Source
write(io : IO)
Source

Macros

asn1_ber(name, onlyif = nil, verify = nil, value = nil)
Source
ber(name, onlyif = nil, verify = nil, value = nil)
Source

Nested types