class asn1::AsnObjBuilder
sys::Obj asn1::AsnObjBuilder
Utility to build an AsnObj
- asnEnum
-
Build an ASN.1
Enumerated
value. - asnNull
-
AsnObj asnNull()
Build an ASN.1
Null
value - bits
-
Build an ASN.1
Bit String
value. The bits in the bit string are numbered from left to right. For example, bits0-7
are in the first byte of the bits buffer. - bool
-
Build an ASN.1
Boolean
value - genTime
-
Build an ASN.1
GeneralizedTime
value. - int
-
Build an ASN.1
Integer
value. Theval
may be either anInt
or aBigInt
, but is always normalized toBigInt
. - make
-
new make()
- octets
-
Build an ASN.1
Octet String
value. Theval
may be:- a
Str
- it will be converted to a Buf as((Str)val).toBuf
- a
Buf
containing the raw octets
- a
- oid
-
Build an ASN.1
Object Identifier
value (OID). Theval
may be:- an
Int[]
where each element of the list is a part of the oid. - a
Str
where each part of the oid is separated by.
.
Asn.oid([1,2,3]) Asn.oid("1.2.3")
- an
- seq
-
Build an ASN.1
SEQUENCE
value Theitems
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.
- An
- set
-
Create an ASN.1
SET
value Theitems
parameter may be any of the values accepted byseq
. - str
-
AsnObj str(Str val, AsnTag univ)
Build one of the ASN.1 string types. The
univ
parameter must be one of:See
utf8
to easily create UTF-8 strings. - tag
-
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
isnull
, 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
-
Build an ASN.1
UTCTime
value - utf8
-
Build an ASN.1
Utf8String
value.