class ASN1::BER
Defined in:
bindata/asn1.crbindata/asn1/data_types.cr
bindata/asn1/identifier.cr
bindata/asn1/length.cr
Constant Summary
-
BIT_PARTS =
[] of Nil
-
ENDIAN =
["big"]
-
INDEX =
[-1]
-
PARTS =
[{"basic", identifier, Identifier, nil, nil, nil, nil}, {"basic", length, Length, nil, nil, nil, nil}] of Nil
Instance Method Summary
- #__format__ : IO::ByteFormat
-
#children
Extracts children from the payload
- #children=(parts)
- #constructed
- #constructed=(custom : Bool)
- #extended
- #extended=(parts : Array(ExtendedIdentifier))
- #extended?
- #get_bitstring
- #get_boolean
-
#get_bytes : Slice(UInt8)
Returns the raw bytes
-
#get_hexstring(universal = true, tag = UniversalTags::OctetString)
Gets a hex representation of the bytes
- #get_integer : Int64
- #get_integer_bytes : Bytes
-
#get_object_id
Returns the object ID in string format
-
#get_string
Returns a UTF8 string
-
#identifier : 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.
- #length : Length
- #length=(length : Length)
- #payload : Bytes
- #payload=(payload : Bytes)
- #read(io : IO) : IO
-
#sequence?
Check if this can be expanded into multiple sub-entries
- #set_boolean(value)
- #set_bytes(data, tag = UniversalTags::OctetString, tag_class = TagClass::Universal)
-
#set_hexstring(string, tag = UniversalTags::OctetString, tag_class = TagClass::Universal)
Sets bytes from a hexstring
- #set_integer(value)
-
#set_object_id(oid)
Sets a string representing an object ID
-
#set_string(string, tag = UniversalTags::UTF8String, tag_class = TagClass::Universal)
Sets a UTF8 string
- #size
- #tag
- #tag_class
- #tag_class=(tag : TagClass)
- #tag_number
- #tag_number=(tag_type : Int | UniversalTags)
- #write(io : IO) : IO
Instance methods inherited from class BinData
__format__ : IO::ByteFormat
__format__,
read(io : IO) : IO
read,
to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian)
to_io,
to_slice
to_slice,
write(io : IO) : IO
write
Class methods inherited from class BinData
from_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian)
from_io
Instance Method Detail
Gets a hex representation of the bytes
def inspect(io : IO) : Nil
#
Description copied from class Reference
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>
Sets bytes from a hexstring
Sets a UTF8 string