Tag

@Serializable
data class Tag : Comparable<Asn1Element.Tag> (source)

Constructors

Link copied to clipboard
constructor(tagValue: ULong, constructed: Boolean, tagClass: TagClass = TagClass.UNIVERSAL)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Template(val tagValue: ULong, val tagClass: TagClass?, val constructed: Boolean?)

A tag with optional tagClass and optional constructed indicator. Used for ASN.1 builder DSL

Properties

Link copied to clipboard
Link copied to clipboard

The length (in bytes) of this tag when encoded according to DER

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun compareTo(other: Asn1Element.Tag): Int

As per ITU-T X.680 8824-1 8.6

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
infix fun withClass(tagClass: TagClass): Asn1Element.Tag

creates a new Tag from this object, overriding the class. Useful for implicitTagging (see Asn1Structure.withImplicitTag)

Link copied to clipboard
infix fun withNumber(number: ULong): Asn1Element.Tag

Creates a copy of this tag, overriding tagValue, but keeping isConstructed and tagClass

Link copied to clipboard
infix fun without(negated: TagProperty): Asn1Element.Tag

creates a new Tag from this object, negating the passed property. Useful for implicitTagging (see Asn1Structure.withImplicitTag). This is a NOOP for tag that don't have this bit set.