ber

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClassUniversal       byte = 0x00
	ClassApplication     byte = 0x40
	ClassContextSpecific byte = 0x80

	Constructed byte = 0x20
)
View Source
const (
	TagBoolean    byte = 0x01
	TagInteger    byte = 0x02
	TagOctet      byte = 0x04
	TagNull       byte = 0x05
	TagEnumerated byte = 0x0a
	TagSequence   byte = 0x10
	TagSet        byte = 0x11
)
View Source
const MaxPacketSize = 16 << 20

Variables

This section is empty.

Functions

func Boolean

func Boolean(value bool) []byte

func Enumerated

func Enumerated(value int) []byte

func Integer

func Integer(value int) []byte

func Null

func Null() []byte

func OctetString

func OctetString(value string) []byte

func Sequence

func Sequence(children ...[]byte) []byte

func Set

func Set(children ...[]byte) []byte

func TLV

func TLV(tag byte, value []byte) []byte

Types

type Packet

type Packet struct {
	Tag      byte
	Value    []byte
	Children []Packet
}

func ReadPacket

func ReadPacket(data []byte) (Packet, int, error)

func ReadPackets

func ReadPackets(data []byte) ([]Packet, error)

func (Packet) Bool

func (p Packet) Bool() (bool, error)

func (Packet) Int

func (p Packet) Int() (int, error)

func (Packet) RequireTag

func (p Packet) RequireTag(tag byte) error

func (Packet) String

func (p Packet) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL