~/bend-docscommunity

tag.bend checks

raw source on the hub · import 0xeb25eff332574f4f1d48668b83cdda30/tag.bend as Tag

bend-osdev-asn1, tags (ITU-T X.680 (02/2021) clause 8: a class and a number; Table 1 assigns the universal ones) and their identifier octets (ITU-T X.690 (02/2021) 8.1.2): bits 8 and 7 the class (Table 1), bit 6 primitive (0) or constructed (1), bits 5 to 1 the number when it is 0 to 30 (8.1.2.2), else 11111 and the number in base-128 subsequent octets, bit 8 set on all but the last, the first not 80 hex (8.1.2.4).

3 imports
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import ./number.bend as Nu

Types

type Asn1Class source · line 11 · raw

Data

type Asn1Tag source · line 17 · raw

Data

type A1Id1 source · line 20 · raw

Data

Definitions

def Asn1Tag.cls source · line 23 · raw

@t:Asn1Tag -> Asn1Class

def Asn1Tag.num source · line 28 · raw

@t:Asn1Tag -> Nat

def Asn1Tag.universal source · line 33 · raw

@n:Nat -> Asn1Tag

def Asn1Tag.context source · line 36 · raw

@n:Nat -> Asn1Tag

def Asn1Tag.boolean source · line 40 · raw

Asn1Tag

The universal tags of X.680 Table 1 that the typed readers use

def Asn1Tag.integer source · line 43 · raw

Asn1Tag

def Asn1Tag.bit_string source · line 46 · raw

Asn1Tag

def Asn1Tag.octet_string source · line 49 · raw

Asn1Tag

def Asn1Tag.null source · line 52 · raw

Asn1Tag

def Asn1Tag.oid source · line 55 · raw

Asn1Tag

def Asn1Tag.enumerated source · line 58 · raw

Asn1Tag

def Asn1Tag.utf8_string source · line 61 · raw

Asn1Tag

def Asn1Tag.sequence source · line 64 · raw

Asn1Tag

def Asn1Tag.set source · line 67 · raw

Asn1Tag

def Asn1Tag.printable_string source · line 70 · raw

Asn1Tag

def Asn1Tag.t61_string source · line 73 · raw

Asn1Tag

def Asn1Tag.ia5_string source · line 76 · raw

Asn1Tag

def Asn1Tag.utc_time source · line 79 · raw

Asn1Tag

def Asn1Tag.generalized_time source · line 82 · raw

Asn1Tag

def Asn1Tag.universal_string source · line 85 · raw

Asn1Tag

def Asn1Tag.bmp_string source · line 88 · raw

Asn1Tag

def Asn1Class.rank source · line 92 · raw

@c:Asn1Class -> Nat

the class's rank in X.680 8.6's canonical order, and its bits 8 and 7

def Asn1Class.is_eq source · line 103 · raw

@a:Asn1Class -> @b:Asn1Class -> Bool

def Asn1Tag.is_eq source · line 106 · raw

@a:Asn1Tag -> @b:Asn1Tag -> Bool

def a1.tag_lt.go source · line 111 · raw

@c:Cmp -> @+n:Nat -> @+m:Nat -> Bool

def Asn1Tag.is_lt source · line 121 · raw

@a:Asn1Tag -> @b:Asn1Tag -> Bool

a before b in X.680 8.6's canonical order of tags

def a1.cls_base source · line 126 · raw

@c:Asn1Class -> Nat

def a1.id_octet source · line 139 · raw

@c:Asn1Class -> @cons:Bool -> @low:Nat -> Nat

the leading identifier octet's value: class bits, the P/C bit, and bits 5 to 1 (low: the number, or 31 for the high-tag form)

def a1.id_pick source · line 142 · raw

@lt:Bool -> @c:Asn1Class -> @cons:Bool -> @+n:Nat -> List<&2, U32>

def a1.id_ok source · line 151 · raw

@+n:Nat -> Bool

whether a tag number has identifier octets here: a low number, or a high one in at most six base-128 octets (number.bend's bound)

def a1.id_bytes source · line 155 · raw

@c:Asn1Class -> @cons:Bool -> @+n:Nat -> List<&2, U32>

the identifier octets of a tag, primitive or constructed (8.1.2)

def a1.id1.pc source · line 160 · raw

@ge:Bool -> @c:Asn1Class -> @+k:Nat -> A1Id1

def a1.id1.cls source · line 167 · raw

@c:Asn1Class -> @+k:Nat -> A1Id1

def a1.id1.a source · line 170 · raw

@ge:Bool -> @+k:Nat -> A1Id1

def a1.id1.c source · line 177 · raw

@ge:Bool -> @+k:Nat -> A1Id1

def a1.id1.p source · line 184 · raw

@ge:Bool -> @+k:Nat -> A1Id1

def a1.id1 source · line 192 · raw

@+k:Nat -> A1Id1

the parts of a leading identifier octet of value k (below 256)