class asn1::AsnObjBuilder

sys::Obj
  asn1::AsnObjBuilder

Source

Utility to build an AsnObj

asnEnum

AsnObj asnEnum(Int val)

Source

Build an ASN.1 Enumerated value.

asnNull

AsnObj asnNull()

Source

Build an ASN.1 Null value

bits

AsnObj bits(Buf bits)

Source

Build an ASN.1 Bit String value. The bits in the bit string are numbered from left to right. For example, bits 0-7 are in the first byte of the bits buffer.

bool

AsnObj bool(Bool val)

Source

Build an ASN.1 Boolean value

genTime

AsnObj genTime(DateTime ts)

Source

Build an ASN.1 GeneralizedTime value.

int

AsnObj int(Obj val)

Source

Build an ASN.1 Integer value. The val may be either an Int or a BigInt, but is always normalized to BigInt.

make

new make()

Source

octets

AsnObj octets(Obj val)

Source

Build an ASN.1 Octet String value. The val may be:

  • a Str - it will be converted to a Buf as ((Str)val).toBuf
  • a Buf containing the raw octets
oid

AsnOid oid(Obj val)

Source

Build an ASN.1 Object Identifier value (OID). The val may be:

  1. an Int[] where each element of the list is a part of the oid.
  2. a Str where each part of the oid is separated by ..
Asn.oid([1,2,3])
Asn.oid("1.2.3")
seq

AsnSeq seq(Obj items)

Source

Build an ASN.1 SEQUENCE value The items parameter may be:

  • An AsnItem[] of raw items to add to the collection
  • An AsnObj[]
  • A Str:AsnObj - if the order of the sequence is important, you should ensure the map is ordered.
set

AsnSet set(Obj items)

Source

Create an ASN.1 SET value The items parameter may be any of the values accepted by seq.

str

AsnObj str(Str val, AsnTag univ)

Source

Build one of the ASN.1 string types. The univ parameter must be one of:

See utf8 to easily create UTF-8 strings.

tag

This tag(AsnTag? tag)

Source

Add a tag to the object builder. Tags should be added in ther order they are specified in an ASN.1 type declaration. If the tag is null, then this is a no-op.

Whenever a concrete AsnObj is built, the builder will clear all tags.

// [0] [1 APPLICATION] Boolean
obj := AsnObjBuilder()
   .tag(AsnTag.context(0).implicit)
   .tag(AsnTag.app(1).implicit)
   .bool(true)
utc

AsnObj utc(DateTime ts)

Source

Build an ASN.1 UTCTime value

utf8

AsnObj utf8(Str val)

Source

Build an ASN.1 Utf8String value.