Documentation ¶
Overview ¶
Package tlv implements various version (ASN.1 BER, Simple, Compact) TLV encoding using in ISO 7816-4.
Index ¶
- Variables
- func EncodeBER(tvs ...TagValue) (buf []byte, err error)
- func EncodeCompact(tvs ...TagValue) (buf []byte, err error)
- func EncodeLengthBER(l int) ([]byte, error)
- func EncodeSimple(tvs ...TagValue) (buf []byte, err error)
- type Class
- type Tag
- type TagValue
- type TagValues
- func (tvs *TagValues) DeleteAll(tag Tag) (removed int)
- func (tvs TagValues) Equal(w TagValues) bool
- func (tvs TagValues) Get(tag Tag) ([]byte, TagValues, bool)
- func (tvs *TagValues) GetAll(tag Tag) (s TagValues)
- func (tvs TagValues) GetChild(tag Tag, subs ...Tag) ([]byte, TagValues, bool)
- func (tvs *TagValues) Pop(tag Tag) (TagValue, bool)
- func (tvs *TagValues) PopAll(tag Tag) (s TagValues)
- func (tvs *TagValues) Put(tv TagValue)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidTag = errors.New("invalid tag") ErrTagToBig = errors.New("tag is too big for this encoding") ErrValueToLarge = errors.New("valye to large for this encoding") )
View Source
var ErrNotConstructed = errors.New("tag is not constructed but contains children")
Functions ¶
func EncodeCompact ¶
func EncodeLengthBER ¶ added in v0.4.0
func EncodeSimple ¶
Types ¶
type Tag ¶
type Tag uint // In theory ISO 7816-4 also supports 3-byte tags
func NewBERTag ¶ added in v0.8.1
NewBERTag creates a new ASN.1 BER-TLV encoded tag field from a value and class. See: ISO 7816-4 Section 5.2.2.1 BER-TLV tag fields
func (Tag) IsConstructed ¶
IsConstructed returns true if the tag is constructed.
func (Tag) MarshalBER ¶ added in v0.3.0
MarshalBER returns a BER-encoded representation of the tag.
type TagValue ¶
func (TagValue) MarshalBER ¶
MarshalBER encodes an ASN.1 BER-TLV encoded tag field. See: ISO 7816-4 Section 5.2.2.1 BER-TLV tag fields
Click to show internal directories.
Click to hide internal directories.